Repository navigation
[ISSUE #11515] Fix swapped socket send/receive buffer config in RemotingHelper.connect - #11516
Open
amalsaidov wants to merge 1 commit into
Open
amalsaidov wants to merge 1 commit into
amalsaidov wants to merge 1 commit into
Conversation
… RemotingHelper.connect RemotingHelper.connect applied socketSndbufSize to the receive buffer and socketRcvbufSize to the send buffer, the opposite of the mapping used everywhere else in the remoting module (NettyRemotingClient and NettyRemotingServer map socketSndbufSize to SO_SNDBUF and socketRcvbufSize to SO_RCVBUF). The store HA clients connect through this method, so tuning the buffer knobs swapped the send and receive buffer sizes on the replication sockets. Set the send buffer from socketSndbufSize and the receive buffer from socketRcvbufSize, and add a test that opens two connections differing only in socketSndbufSize and checks the resulting send buffer tracks it.
lwclover
approved these changes
Nov 13, 2026
Member
|
LGTM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #11516 +/- ##
=============================================
- Coverage 49.79% 49.79% -0.01%
+ Complexity 14407 14406 -1
=============================================
Files 1391 1391
Lines 103381 103381
Branches 13529 13529
=============================================
- Hits 51477 51476 -1
+ Misses 45686 45682 -4
- Partials 6218 6223 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Which Issue(s) This PR Fixes
Fixes #11515
Brief Description
RemotingHelper.connectwired the socket buffer knobs to the wrong options:socketSndbufSizewas applied withsetReceiveBufferSizeandsocketRcvbufSizewithsetSendBufferSize. Every other place in the remoting module mapssocketSndbufSizetoSO_SNDBUFandsocketRcvbufSizetoSO_RCVBUF(seeNettyRemotingClientandNettyRemotingServer), so these two were swapped.The store HA replication clients (
DefaultHAClient,AutoSwitchHAClient) connect through this method, so tuning the buffer sizes gave the replication sockets the opposite send/receive buffer from what was configured.This PR sets the send buffer from
socketSndbufSizeand the receive buffer fromsocketRcvbufSize.How Did You Test This Change?
Added
RemotingHelperTest#testConnectAppliesSndAndRcvBufferToMatchingSocketOption. The OS clamps and scales requested buffer sizes, so the test opens two connections that differ only insocketSndbufSizeand reads back the send buffer from both: the connection configured with the smaller send buffer must end up with the smaller send buffer. With the knobs swapped the send buffer followssocketRcvbufSize, which inverts the comparison and fails the test.Verified the test fails before the change and passes after, with
mvn -pl remoting -am test -Dtest=RemotingHelperTest.AI-assisted; directed, reviewed and tested by the author (amalsaidov).