#2948 lite-server does not exit cleanly on Ctrl+C
Closed: Fixed None Opened 11 years ago by pviktori.

Sending SIGINT to the lite-server causes it to abort, not running any cleanup (i.e. finally blocks).
This prevents collecting coverage data, as that data is only saved on clean interpreter shutdown.

After far too much bisection, I've tracked the problem down to importing the samba module (via ipaserver.dcerpc via the trust plugin).

Just importing samba makes SIGINT cause Python to die, instead of raising KeyboardInterrupt. It's most likely due to the following braindead code in samba4-python's source4/scripting/python/pyglue.c:

        /* one of the most annoying things about python scripts is
           that they don't die when you hit control-C. This fixes that
           sillyness. As we do all database operations using
           transactions, this is also safe. 
        */
        signal(SIGINT, SIG_DFL);

This is a regression added in a7420c1. I've been using a workaround since then.


This needs to be put in the backlog, it only affects developers and there's no time now.

This was fixed upstream.

Metadata Update from @pviktori:
- Issue assigned to pviktori
- Issue set to the milestone: Ticket Backlog

7 years ago

Login to comment on this ticket.

Metadata