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
sched.scheduler.run() blocks scheduler #60369
Comments
sched.scheduler.run() blocks scheduler and prevents the addition of new events until all events added before start will not be processed. Canceling does not work too. Here is test script which reproduces the behavior differences. Output in Python 3.2: Adding Output in Python 3.3: Adding
adding 0
start event
added 0
adding 1
added 1
adding 2
added 2
Canceling
event 0
event 1
event 2
Traceback (most recent call last):
File "schedtest.py", line 20, in <module>
s.cancel(e)
File "/home/serhiy/py/cpython/Lib/sched.py", line 93, in cancel
self._queue.remove(event)
ValueError: list.remove(x): x not in list |
Here is a patch that releases lock for other threads. |
Tests added. Please review. |
Oh, I submitted wrong patch (it contained unrelated changes). Here is a right one. |
If no one objects I will commit this next year. |
Sorry for chiming in so late. |
Sorry, Chris. I have opened too many browser tabs. ;) |
New changeset 467c46e312eb by Serhiy Storchaka in branch '3.3': New changeset ac919a281643 by Serhiy Storchaka in branch 'default': |
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: