make check gets stuck very reproducible in my VM at Test run #218:
After fiddling a bit around with it I got it to work by increasing the alarm() timeout from 2 seconds to 4 seconds.
I'm not a Python expert, but the code looks somewhat interesting to me:
- The server code starts the workers, but some piece of code outside of the server is responsible for terminating them. Is that really idiomatic in Python or just bad design?
- The Condition() object used in TProcessPoolsServer.py should probably be replaced by an Event() object. Especially, as Condition.wait() seems to have it's own perils and Event is much easier to use.
- Calling Condition.aquire() without a matching release() within a while True: loop looks also not very convincing to me. AFAIK the second call to aquire() will block, if that ever happens (it did not in my tests).
The bad news is, that neither of the proposed changes above had any effect on the race conditions, except increasing the timeout - but that is merely a workaround, not a solution.