grpc-ecosystem / grpc-ecosystem/grpc-spring

Connection closed by server after 20s vs. keep-alive

Open
#996 0 comments 1 reaction 0 assignees View on GitHub
question
Dominant language
Java
Stars
3.7k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

**The context**

Hello. I am trying to equalize keep-alive settings between client and server to avoid unnecessary go-aways due to misbehaving clients

**The question**

I came across a strange behavior.
If there is no interaction between client and server, 20s after last HTTP2/RST_STREAM, server sends HTTP2/GOAWAY which leads to closing of HTTP2 as well as TCP connection.
This happens both
* If there is enable-keep-alive set to false in both client and server (which is expected)
* If I changed enable-keep-alive and permit-keep-alive-without-calls to true, HTTP2/PINGs are being sent but connection is terminated anyway

Is this expected behavior?
Am I able to change the timeout? Or rather... Am I supposed to change this, or this is a sensible default?
Thank you

**Stacktraces and logs**

![image](https://github.com/grpc-ecosystem/grpc-spring/assets/22494464/9341f38c-c3f8-4e74-9c3c-bb39d8e6e47c)

**The application's environment**

* Spring (boot): 2.7.5
* grpc-java: 1.59.0
* grpc-spring-boot-starter: 2.15.0.RELEASE
* java: version + architecture (64bit?): 11.0.18+10-LTS, Kotlin: 1.9.10

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the idle HTTP/2 connection behavior with grpc-java 1.59.0, Spring Boot 2.7.5, and the reported keep-alive settings. Compare the behavior with and without permit-keep-alive-without-calls enabled, then establish whether the 20-second GOAWAY timeout is configurable; done should be a confirmed explanation or a clearly scoped change request.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, java, kotlin, spring-boot
Domain
api, backend, networking
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.