This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: multiprocessing.Event.wait hangs when interrupted by signal that sets the event
Type: behavior Stage:
Components: Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: salvatore.ingala
Priority: normal Keywords:

Created on 2020-08-21 08:01 by salvatore.ingala, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
event-test.py salvatore.ingala, 2020-08-21 08:01 Test code for multiprocessing.Event
Messages (1)
msg375745 - (view) Author: Salvatore Ingala (salvatore.ingala) Date: 2020-08-21 08:01
According to the docs, multiprocessing.Event is a clone of threading.Event. Yet, there is a strange behavior that is observed only on multiprocessing.Event. If an event.wait() is interrupted by a SIGINT and the signal handler sets the event, then the call to event.set() hangs if event is an instance of multiprocessing.Event, in what looks like a deadlock; instead, it works as expected if it's an instance of threading.Event.

See the file attached for a reproduction.

It seems to have been so for a long time, see: https://stackoverflow.com/questions/24422154/multiprocessing-event-wait-hangs-when-interrupted-by-a-signal/30831867
History
Date User Action Args
2022-04-11 14:59:35adminsetgithub: 85772
2020-08-21 08:01:43salvatore.ingalacreate