okhttp: Fix bidirectional keep-alive causing spurious GO_AWAY by kssumin · Pull Request #12502 · grpc/grpc-java

@kssumin

When bidirectional keep-alive is enabled (both client and server
sending keep-alive pings), the server incorrectly validates ping
acknowledgments (ACKs) sent in response to server-initiated pings.
This causes the KeepAliveEnforcer strike counter to increment for
legitimate protocol responses, eventually triggering a GO_AWAY with
ENHANCE_YOUR_CALM.

Move the keepAliveEnforcer.pingAcceptable() check inside the !ack
conditional block, so only client-initiated ping requests are
validated. Ping ACKs now bypass enforcement entirely, enabling
bidirectional keep-alive to work correctly.

Fixes grpc#12417

ejona86

approved these changes Nov 12, 2025

@ejona86 ejona86 added the kokoro:run

Add this label to a PR to tell Kokoro the code is safe and tests can be run

label

Nov 12, 2025

@grpc-kokoro grpc-kokoro removed the kokoro:run

Add this label to a PR to tell Kokoro the code is safe and tests can be run

label

Nov 12, 2025

@github-actions github-actions bot locked as resolved and limited conversation to collaborators

Feb 12, 2026