You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
issue #147, pool: do not block when trying to terminate tasks
In order to stop cancelled or timing out tasks, the Pool Manager
loop needs to acquire the channel lock to prevent any worker from
accessing either the lock or the pipe during its termination.
The previous logic would try to acquire the lock indefinitely. This
led to possible deadlocks in case the Pool Manager was trying to stop
cancelled tasks with the results channel filled up while the pool was
terminated. This was due to the workers holding the channel lock while
being unable to push the data as the Message Manager loop was not
reading it anymore.
The new Pool Manager loop does not try to acquire the lock indefinitely but
rather polls it for availability. This allows the loop to continue
assessing its state and correctly terminate upon request.
The drawback of this implementation is that timing out or cancelled
tasks might be stopped a little later in case the pipe is busy
transferring lots of data.
0 commit comments