medialab / quenouille

A library of multithreaded iterator workflows for python.
MIT License
7 stars 0 forks source link

Track down every piece of code that could hang because of a KeyboardInterrupt #43

Open Yomguithereal opened 3 years ago

Yomguithereal commented 3 years ago

And edit the startup hook to make threads die before waiting barrier, or break the barrier

Yomguithereal commented 3 years ago

We still have an error possible when booting the dispatcher and when join the threads in exit

Yomguithereal commented 3 years ago

Maybe state also needs to release condition on imap cleanup.

Yomguithereal commented 3 years ago

raise KeyboardInterrupt in cleanup and shutdown

Yomguithereal commented 3 years ago

Basically the issue is this one: https://stackoverflow.com/questions/18637048/avoid-exception-ignored-in-python-enhanced-generator when a KeyboardInterrupt is fire in the cleanup phase (finally in the output generator or the __exit__ teardown).

Yomguithereal commented 3 years ago

Also see PEP419: https://www.python.org/dev/peps/pep-0419/

Yomguithereal commented 3 years ago

Also see this ref: https://vorpus.org/blog/control-c-handling-in-python-and-trio/