Author selimb
Recipients asvetlov, selimb, yselivanov
Date 2021-02-01.20:57:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1612213058.31.0.316074698838.issue43064@roundup.psfhosted.org>
In-reply-to
Content
Playing with this a bit more, I found a weird workaround. By adding the following to the top of worker_sync(), Experiment 1 produces the expected result.

def worker_sync():
    async def clear_asyncio_signal_handlers():
        loop = asyncio.get_event_loop()
        loop.add_signal_handler(signal.SIGINT, signal.SIG_IGN)
    asyncio.run(clear_asyncio_signal_handlers())

    if WORKER_SIGNAL_HANDLER is WorkerSignalHandler.NONE:
    [...]

FYI, this did *not* work (the outcome is still the same for Experiment 1):

def worker_sync():
    loop = asyncio.get_event_loop()
    loop.add_signal_handler(signal.SIGINT, signal.SIG_IGN)

    if WORKER_SIGNAL_HANDLER is WorkerSignalHandler.NONE:
    [...]


Maybe this all can be flagged as "as designed". However, perhaps it could be documented?
History
Date User Action Args
2021-02-01 20:57:38selimbsetrecipients: + selimb, asvetlov, yselivanov
2021-02-01 20:57:38selimbsetmessageid: <1612213058.31.0.316074698838.issue43064@roundup.psfhosted.org>
2021-02-01 20:57:38selimblinkissue43064 messages
2021-02-01 20:57:38selimbcreate