New submission from Roger Dahl <g...@dahlsys.com>:

This is a ticket to document two ways in which the behavior of 
loop.set_signal_handler() may not match what the user expects.

First, callbacks to handlers registered with loop.set_signal_handler() may be 
significantly delayed. I have a program where I've encountered delays of up to 
maybe a minute or so between hitting Ctrl-C and getting the callback for the 
SIGINT handler. During this time, the program works through queued aiohttp 
tasks. Though it's possible to have delays in callbacks for events set with 
signal.signal(), I haven't personally seen that, and I think that's the case 
for most users. So I think this point should be included in the docs.

Second, set_signal_handler() silently and implicitly removes corresponding 
handlers set with signal.signal(). Though perhaps logical, this potentially 
removes a "fast" handler and replaces it with a "slow" one. I think this should 
be documented as well.

----------
components: asyncio
messages: 362734
nosy: asvetlov, rogerdahl, yselivanov
priority: normal
severity: normal
status: open
title: asyncio loop.set_signal_handler() may not behave as expected
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39765>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to