Closed vytasrgl closed 1 year ago
Intriguing. I'll spend some time working on it!
Have committed an initial fix. Still need to add a few more tests.
Thanks. The fix seem to solve issues i had, but i will test further and report if it doesn't work as expected.
Even with 842a8c6 it seems there is issue with the locking. I am getting it while setting the event from regular thread.
Set changed size during iteration at:
/curio/sync.py", line 122, in set
curio/sync.py", line 113, in _unblock_waiters
for fut in self._waiting:
I've made a few more changes to avoid this.
After further testing seems working fine now. Thanks for prompt fix.
Thanks for submitting this. It revealed a number of bugs in the UniversalEvent implementation.
Currently it seems if waiter for UniversalEvent times out the event becomes unusable and can not be set, and if there are multiple waiters those would not be informed either. The regular
Event
class works fine with the test case below.For now i have no fix for it. Consider the following test case would fail with
InvalidStateError: CANCELLED: <Future at 0x7fcefc671a30 state=cancelled>
in curio/sync.py:100OS: Ubuntu 20.04 with Python3.8