Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track client-initiated shutdown for any pipe type #2814

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

bgrainger
Copy link
Contributor

@bgrainger bgrainger commented Nov 11, 2024

Fixes #2652

Previously, RecordQuit only recorded a client-initiated QUIT if _ioPipe was a SocketConnection, which is not true when using SSL.

Since there is a 1-1 relationship between PhysicalConnection and _ioPipe, store whether the client initiated the shutdown on the PhysicalConnection object instead of (only) delegating it to SocketConnection.

The line var pipe = connectingPipe ?? _ioPipe seems irrelevant to this PR because connectingPipe is only set once, in ConnectedAsync, and would be relevant only if an exception were thrown between when pipe is set and when its value is assigned to _ioPipe (i.e., between lines 1612-15).

@bgrainger
Copy link
Contributor Author

(I'm not set on using Thread.VolatileRead/Write to store this information; it just seemed in line with what was already being done in SocketConnection.)

@bgrainger
Copy link
Contributor Author

The branch name is wrong; this actually fixes #2652.

@bgrainger
Copy link
Contributor Author

The PR CI job succeeded the first time: https://github.com/StackExchange/StackExchange.Redis/actions/runs/11786652807
This probably just needs to be re-run.

Copy link
Collaborator

@NickCraver NickCraver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you sir!

@teemka
Copy link

teemka commented Feb 27, 2025

@bgrainger will you try reruning CI and merging? Thanks :)

@NickCraver NickCraver merged commit 3bd3e66 into StackExchange:main Mar 4, 2025
5 of 6 checks passed
@bgrainger bgrainger deleted the bug2701 branch March 5, 2025 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RedisConnectionException: SocketClosed after Dispose of ConnectionMultiplexer
3 participants