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

Avoid race condition on client._conns in send() #1772

Merged
merged 1 commit into from
Apr 1, 2019
Merged

Conversation

dpkp
Copy link
Owner

@dpkp dpkp commented Mar 31, 2019

There was a very small possibility that between checking self._can_send_request(node_id) and grabbing the connection object via self._conns[node_id] that the connection could get closed / recycled / removed from _conns and cause a KeyError. This PR should prevent such a KeyError. In the case where the connection is disconnected by the time we call send(), we should expect conn.send() simply to fail the request.


This change is Reviewable

@jeffwidman
Copy link
Contributor

Makes sense and looks very straightforward, merging

@jeffwidman jeffwidman merged commit c02df4b into master Apr 1, 2019
@jeffwidman jeffwidman deleted the client_send_race branch April 1, 2019 02:22
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