Fixes #220: Change worker exception to BaseException#221
Fixes #220: Change worker exception to BaseException#221dxdc wants to merge 2 commits intouqfoundation:masterfrom
Conversation
|
The code mirrors the stdlib |
|
@mmckerns ok thanks. I'm not sure how to get the tests to pass, as I'm not very familiar with this library. but these tests definitely seem to hang. def test_map_sigterm_base_exception(self):
def _sigterm_worker(x):
def _handler(signum, frame):
raise SystemExit(f"worker received SIGTERM on input={x}")
signal.signal(signal.SIGTERM, _handler)
os.kill(os.getpid(), signal.SIGTERM)
try:
self.pool.map_async(_sigterm_worker, list(range(3))).get(timeout=SHUTDOWN_TIMEOUT)
except multiprocessing.TimeoutError:
self.fail("pool.map_async with sigterm stalled on base exception")
def test_imap_sigterm_base_exception(self):
def _sigterm_worker(x):
def _handler(signum, frame):
raise SystemExit(f"worker received SIGTERM on input={x}")
signal.signal(signal.SIGTERM, _handler)
os.kill(os.getpid(), signal.SIGTERM)
try:
for _ in self.pool.imap(_sigterm_worker, list(range(3))):
pass
except multiprocessing.TimeoutError:
self.fail("pool.map_async with sigterm stalled on base exception")
|
|
@mmckerns any chance you could review this again? I made the other changes |
|
@mmckerns just bumping this in case it got buried — whenever you have a chance, I’d appreciate another look. Thanks! |
Summary
See: #220
There may be more work required as I'm not sure how extensively these changes need to be propagated. I'm happy to add tests, etc. but I am not very familiar with the project structure and it seems the code is duplicated into multiple places.
Checklist
Documentation and Tests
python tests/__main__.py, and pass.Release Management