Repository navigation
Fixed - connection with an unanswered command after a response timeout is reused first by retries and new commands - #7375
Open
ohksj77 wants to merge 1 commit into
Conversation
…t is reused first by retries and new commands Signed-off-by: ohksj77 <ohksj77@gmail.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.
Fixes #7373
Problem
With the LIFO pool (since 3.52.0), a connection released after a response timeout goes back to the head of the free deque. The retry and new commands then poll the same connection and are pipelined behind the timed-out command, which stays in the channel's
COMMANDS_QUEUEuntil its reply arrives.Change
ConnectionsHolder.releaseConnection()releases a connection that still has unanswered commands to the tail of the free deque.RedisConnection.hasPendingCommands().usage > 1) and the pubsub pool keep the current behaviour.Tests
ConnectionsHolderTest: covers release to the tail, LIFO for healthy connections, shared connections, and fallback when only one connection is free.RedissonTest.testStalledConnectionIsNotReusedAfterResponseTimeout:WAITexceeds the response timeout on one connection, then an immediateGETfollows. Before this change theGETtimes out on the same channel; with it, theGETsucceeds.