-
Notifications
You must be signed in to change notification settings - Fork 10
Improve async robustness and cleanup #411
Copy link
Copy link
Open
Labels
part:channelsAffects channels implementationAffects channels implementationpart:coreAffects the core types (`Sender`, `Receiver`, exceptions, etc.)Affects the core types (`Sender`, `Receiver`, exceptions, etc.)part:experimentalAffects the experimental packageAffects the experimental packagepart:synchronizationAffects the synchronization of multiple sources (`select`, `merge`)Affects the synchronization of multiple sources (`select`, `merge`)part:utilitiesAffects the utility receivers (`Timer`, `Event`, `FileWatcher`)Affects the utility receivers (`Timer`, `Event`, `FileWatcher`)priority:highAddress this as soon as possibleAddress this as soon as possibletype:bugSomething isn't workingSomething isn't working
Milestone
Metadata
Metadata
Assignees
Labels
part:channelsAffects channels implementationAffects channels implementationpart:coreAffects the core types (`Sender`, `Receiver`, exceptions, etc.)Affects the core types (`Sender`, `Receiver`, exceptions, etc.)part:experimentalAffects the experimental packageAffects the experimental packagepart:synchronizationAffects the synchronization of multiple sources (`select`, `merge`)Affects the synchronization of multiple sources (`select`, `merge`)part:utilitiesAffects the utility receivers (`Timer`, `Event`, `FileWatcher`)Affects the utility receivers (`Timer`, `Event`, `FileWatcher`)priority:highAddress this as soon as possibleAddress this as soon as possibletype:bugSomething isn't workingSomething isn't working
What happened?
When we wrote this library, we didn't fully understand the details of
asyncioand how to do cleanup and cancellation properly. It is not a surprise, as this can be extremely tricky and the documention forasynciois not great at specifying this. Because of this we ended up with some code that either is not cleaning up properly, or it is hard to clean up properly.What did you expect instead?
Things to be more robust and clean up properly.
Affected version(s)
No response
Affected part(s)
Channels,
Broadcast,Anycast, etc. (part:channels), Core types (Sender,Receiver, exceptions, etc.) (part:core), Experimental features (theexperimentalpackage) (part:experimental), Utilities (Event,FileWatcher,Timer, etc.) (part:utilities), Synchronization of multiple sources (select(),merge(), etc.) (part:synchronization)Extra information
We should fix at least these:
__del__methodsselect()an async context manager (make the function use the context manager and deprecate it)awaitis a checkpoint. If not, we should probably add checkpoints to allasyncfunctions