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

fix(core): Use a copy of auth data when reconnecting #509

Merged
merged 2 commits into from
Oct 6, 2018

Conversation

arushiagg
Copy link
Contributor

It is possible to race between processing a new addAuth request(which updates the client.auth_data set) and iterating through it during reconnect. To avoid set changes during iteration, make a copy.

@arushiagg arushiagg changed the title Use a copy of auth data when reconnecting fix: Use a copy of auth data when reconnecting Jun 9, 2018
@arushiagg
Copy link
Contributor Author

arushiagg commented Jun 9, 2018

One of the tests seems to have had a connection loss error. Does not seem related to the change. Is there a way i can rerun the tests?

Copy link
Member

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

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

The problem description / solution seems reasonable... happy to merge a fix.

Our changelog generator script requires commit messages to be formatted like this: https://github.com/python-zk/kazoo/blob/master/CONTRIBUTING.md#git-commit-guidelines

Can you rebase and update the commit message accordingly?

kazoo/protocol/connection.py Outdated Show resolved Hide resolved
@arushiagg arushiagg force-pushed the master branch 2 times, most recently from c2b0433 to aef041b Compare October 2, 2018 15:30
It is possible to race between processing a new addAuth request(which updates the client.auth_data set) and iterating through it during reconnect. To avoid set changes during iteration, make a copy.
@arushiagg
Copy link
Contributor Author

Rebased, and updated to fix commit message/typo.

@arushiagg arushiagg changed the title fix: Use a copy of auth data when reconnecting fix(core): Use a copy of auth data when reconnecting Oct 2, 2018
Copy link
Member

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

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

Looks good, I fixed the merge conflict caused by merging #512 before this. Waiting for tests to pass so that I can merge it.

@jeffwidman jeffwidman merged commit de20be9 into python-zk:master Oct 6, 2018
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