-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix scan iter command issued to different replicas #3220
base: master
Are you sure you want to change the base?
Conversation
11253ba
to
241033d
Compare
Some of the CI tests fails flakily with a segmentation fault - if i rerun the CI in my fork, it would work most of the time. But I don't have permission to rerun it in the main repository. |
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.
Thanks, this is a valid point. I left some comments in the changes, and I have one more general comment: the implementation covers now the async code. Did you leave out the sync code intentionally, or would it make sense to also adapt that one?
else: | ||
# Check from the available connections, if any of the connection | ||
# is connected to the host and port that we want | ||
for available_connection in self._available_connections.copy(): |
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.
What if there are many connections? This linear search might slow down things.
@@ -122,6 +147,7 @@ def __init__(self, service_name, sentinel_manager, **kwargs): | |||
self.sentinel_manager = sentinel_manager | |||
self.master_address = None | |||
self.slave_rr_counter = None | |||
self._request_id_to_replica_address = {} |
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.
Would it make sense to use a more general name, e.g. instead of request_id
use context_id
? Would it express better the fact that you are basically trying to run several commands in the same context?
await self.release(connection) | ||
raise | ||
# Store the connection to the dictionary | ||
self._request_id_to_replica_address[iter_req_id] = ( |
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.
When would these entries be removed from the dict? So that it does not grow indefinitely.
Those segmentation faults have been there for a long time, to be honest I have no idea why they happen. They are so annoying. Eventually I'll spend some time trying to dig deeper. |
Pull Request check-list
Ubuntu 22.04
,python3.11.2
redis.asyncio.sentinel
module. I wanted to check if the rST syntax is correct, but this module is not included in the builddir's index, so I think it's no-op.fix scan iter command issued to different replicas
Fixes #3197. See linked issue for full description of the bug