Skip to content

MOD-14850 Fix crash in race between MR_ClusterAsyncDisconnect and MR…#91

Merged
AvivDavid23 merged 5 commits into
masterfrom
MOD-14850
Apr 20, 2026
Merged

MOD-14850 Fix crash in race between MR_ClusterAsyncDisconnect and MR…#91
AvivDavid23 merged 5 commits into
masterfrom
MOD-14850

Conversation

@AvivDavid23

@AvivDavid23 AvivDavid23 commented Apr 19, 2026

Copy link
Copy Markdown
Collaborator

…_ClusterOnDisconnectCallback
Fix a race in MR_ClusterAsyncDisconnect: a deferred disconnect task scheduled after a TLS handshake failure runs after MR_ClusterOnDisconnectCallback has already nulled n->c, causing redisAsyncFree(NULL).


Note

Medium Risk
Touches async connection lifecycle and TLS error handling, where subtle ordering issues can cause regressions; changes are small and covered by new race/TLS tests.

Overview
Prevents a crash when a deferred MR_ClusterAsyncDisconnect runs after hiredis has already processed a disconnect and cleared n->c (common on TLS handshake failures) by guarding redisAsyncFree and nulling the pointer after freeing.

Cleans up the TLS connect failure path by removing a temporary hiredis callback-reset workaround, and extends the test suite with a targeted reproduction (test_disconnect_race.py), TLS-capable shard mocks in test_network.py, and a single-node TLS test run in the test module Makefile.

Reviewed by Cursor Bugbot for commit 5e13e85. Bugbot is set up for automated code reviews on this repo. Configure here.

@AvivDavid23 AvivDavid23 changed the title MOD-14850 Fix crush in race between MR_ClusterAsyncDisconnect and MR… MOD-14850 Fix crash in race between MR_ClusterAsyncDisconnect and MR… Apr 19, 2026
@AvivDavid23

Copy link
Copy Markdown
Collaborator Author

This pr also delete some temporary fix code which is not needed anymore(#51)

@AvivDavid23 AvivDavid23 merged commit 2857cfe into master Apr 20, 2026
4 of 8 checks passed
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.

2 participants