-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update hiredis-cluster to 0.14.0 from 0.11.0 #48
Conversation
This commit updates the Minilla version from 3.1.22 to 3.1.23 in the META.json file. This change ensures that the metadata reflects the correct versioning.
To clear HIRCLUSTER_FLAG_SHUTDOWN flag, explicitly call redisClusterConnect2 immediately after fork.
Need for Fork Behavior Change and ConsiderationsTo ensure fork-safe code and reuse the cluster topology obtained by the parent process in the child process, several adjustments are made at Redis::Cluster::Fast using hiredis-cluster 0.11.0 . Previous Behavior (0.10.0)
Previous Behavior (0.11.0)
Upcoming Behavior (0.14.0)
Two Options for Reconnection
In either option, the cluster topology will be updated. However, considering that there may still be unissued handlers from the asynchronous In option (2.), if there are remaining handlers for the asynchronous In either option, To avoid creating dangling pointers, all remaining handlers must be executed. It is necessary to execute event_base_dispatch. Because the Since there’s no significant difference, either method should work. |
Add missing event_base_dispatch call after async disconnect to ensure the event loop is properly dispatched and not to create dangling pointers. This change ensures that all pending handlers are processed but all of them will return quiqkly by HIRCLUSTER_FLAG_SHUTDOWN.
Moved the assignment of self->pid closer to re-connection success check in src/Fast.xs. This ensures that the process ID is set only after a successful re-connection attempt.
return; | ||
} | ||
|
||
if (redisClusterConnect2(self->acc->cc) != REDIS_OK) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MEMO]
I implemented (1.) as it allows for a more simple solution.
Issue event_reinit and redisClusterAsyncDisconnect, then use redisClusterConnect2 to clear the shutdown flag and reconnect.
Since there’s no significant difference, either method should work.
fix: #45