grpc-ecosystem / grpc-ecosystem/grpc-spring
Connection closed by server after 20s vs. keep-alive
- 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**

**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
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