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
Occasional RuntimeError from Condition.notify #66381
Comments
Condition.wait() modifies self._waiters without holding the lock (when a wait with timeout times out without the condition being notified). If this happens to occur in between construction of the _islice and _deque objects in Condition.notify(): def notify(self, n=1):
[...]
all_waiters = self._waiters
waiters_to_notify = _deque(_islice(all_waiters, n)) then the result is a RuntimeError exception:
RuntimeError: deque mutated during iteration (I have a server which makes extensive use of conditions on which this happens about once a day.) This patch fixes this bug by moving wait()'s modification of self._waiters to be inside the lock, as suggested by Antoine Pitrou here: http://bugs.python.org/issue17385#msg183875 |
+1. I agree it's a bug, that the diagnosis is correct, and that the patch will fix it :-) |
So, what happens now? What do I need to do to make progress on this? |
New changeset 4cce39cfe46c by Antoine Pitrou in branch '3.4': New changeset 78a38f8bd5d9 by Antoine Pitrou in branch 'default': |
It only needed someone to push your patch, which I just did. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: