Title: AsyncResult.get() only notifies one thread
Type: Stage:
Components: Library (Lib) Versions: Python 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: AlexWithBeard, xtreak
Priority: normal Keywords:

Created on 2018-08-09 14:17 by AlexWithBeard, last changed 2018-08-09 15:28 by xtreak.

File name Uploaded Description Edit AlexWithBeard, 2018-08-09 14:17 Reproduction script
Messages (1)
msg323323 - (view) Author: Alexander Tsvetkov (AlexWithBeard) Date: 2018-08-09 14:17
If more than one thread is waiting for the multiprocessing.pool.AsyncResult (aka ApplyResult) returned from apply_async, only one thread will be notified once the result arrives.

It happens because AsyncResult._set calls notify upon the result arrival, not notify_all.

threading.Event used in Python 3 uses notify_all.

Reproduction script is attached.
Expected outcome:
is printed to STDOUT.

Observed outcome:
The script hangs.
Date User Action Args
2018-08-09 15:28:00xtreaksetnosy: + xtreak
2018-08-09 14:17:49AlexWithBeardcreate