Fix race condition in Sentinel connection multiplexer by ewisuri · Pull Request #2133 · StackExchange/StackExchange.Redis
Navigation Menu
{{ message }}
StackExchange / StackExchange.Redis Public
- Notifications You must be signed in to change notification settings
- Fork 1.6k
Merged
Fix race condition in Sentinel connection multiplexer#2133
NickCraver merged 2 commits intoStackExchange:mainfrom
ewisuri:main
Fix race condition in Sentinel connection multiplexer#2133
NickCraver merged 2 commits intoStackExchange:mainfrom
ewisuri:main
Conversation
Copy link Copy Markdown
Contributor
ewisuri
commented
May 7, 2022
ewisuri
commented
In the Sentinel Connection Multiplexer, since OnManagedConnectionRestored can be executed on a different thread, it's possible for it to dispose the timer just before OnManagedConnectionFailed calls .Change() on the timer, which leads to an ObjectDisposedException being thrown in OnManagedConnectionFailed. Since the connection was restored, it seems safe to suppress these exceptions, instead of requiring locking around the reference to connection.sentinelPrimaryReconnectTimer.
NickCraver
self-assigned this
NickCraver approved these changes May 10, 2022
Copy link Copy Markdown
Collaborator
NickCraver
left a comment
NickCraver
left a comment
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good - thanks for the fix here!
NickCraver
merged commit
dc9a9b6
into
StackExchange:main
NickCraver
added
the
🪲 bug
label
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