Fix server sending unnecessary proactive keepalives#1130
Open
wdroste wants to merge 1 commit intorsocket:masterfrom
Open
Fix server sending unnecessary proactive keepalives#1130wdroste wants to merge 1 commit intorsocket:masterfrom
wdroste wants to merge 1 commit intorsocket:masterfrom
Conversation
The server was incorrectly using ClientKeepAliveSupport which sends proactive KEEPALIVE frames with the Respond flag. Added ServerKeepAliveSupport that only monitors for timeout without initiating keepalives, per the RSocket protocol specification. Changes: - Added ServerKeepAliveSupport inner class to KeepAliveSupport whose onIntervalTick() only calls tryTimeout() without sending frames - Added serverSide parameter to RSocketRequester constructor to select the appropriate KeepAliveSupport implementation - Updated RSocketServer to pass serverSide=true when creating the RSocketRequester - Added tests verifying server does not send proactive keepalives, still responds to client keepalives, and still detects timeout Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ClientKeepAliveSupportwhich sends proactive KEEPALIVE frames with the Respond flag on a timer. Per the RSocket protocol, the server should only respond to client-initiated keepalives, never initiate its own.ServerKeepAliveSupportthat only monitors for keepalive timeout (detecting client disappearance) without sending proactive keepalive framesRSocketServernow usesServerKeepAliveSupporton the server side instead ofClientKeepAliveSupportChanges
KeepAliveSupport.java- AddedServerKeepAliveSupportinner class whoseonIntervalTick()only callstryTimeout()(no frame sending)RSocketRequester.java- Added constructor overload withserverSideboolean to select the appropriate keepalive supportRSocketServer.java- PassesserverSide=truewhen constructingRSocketRequesterKeepAliveTest.java- 4 new tests verifying server keepalive behaviorTest plan
🤖 Generated with Claude Code