Xpra: Ticket #626: server does not run cleanups on SIGINT from a console

Calling xpra stop (or even xpra exit) cause the cleanups to run, but when sending a SIGINT (ie: control-C) they don't...

Tue, 05 Aug 2014 09:03:56 GMT - Antoine Martin: owner, status, summary changed

Edited title: this only occurs when running from a console, not from an xterm!??? (also affects Fedora 20 and probably others too)

Tue, 05 Aug 2014 09:43:19 GMT - Antoine Martin: status changed; resolution set; keywords deleted

I don't really understand the problem, so this is more of an ugly workaround than a proper fix: r7134 fires all the cleanups from the server cleanup method which is called when we receive a signal.

Thu, 07 Aug 2014 14:20:45 GMT - Antoine Martin: status changed; resolution deleted

This change was breaking profiling and has been reverted in r7181.

We need a solution that:

Bonus would be if we could also kill the vfb without killing the server process by ensuring that the cleanups close all the X11 server connections.

Wed, 29 Apr 2015 09:26:29 GMT - Antoine Martin: status changed; resolution set

No idea why, but gtk_main just exited without returning control to us when our sys.excepthook override hack was in place, so r9197 unregisters it in the signal handler (and also from do_quit for good measure) and the process now exits cleanly again when we send control-c to the console.

(will backport)

Tue, 05 May 2015 04:06:08 GMT - Antoine Martin: status changed; resolution deleted

Re-opening because of ticket:852#comment:4, r9197 caused problems because of a typo. Maybe the implementation error is what made it work from the console?

Sun, 10 May 2015 12:05:35 GMT - Antoine Martin:

Related: r9292 should make exit on CTRL_C more reliable on win32.

Sun, 10 May 2015 15:59:51 GMT - Antoine Martin:

r9294 also makes it more likely that we won't just hang on a signal: the second signal should force quit - even if that means a less clean exit. (particularly relevant with gtk3)

Mon, 11 May 2015 09:43:02 GMT - Antoine Martin:

Well, now that's interesting: it is the error (the typo) raised in the cleanup function which allowed the atcleanups functions to run, without it we end up running the server cleanups but not the regular python atexit cleanups. But we want both!

So r9295 uses sys.exit from the signal handler, and that seems to do the trick. Do not ask why, I think I have tried everything else.

Will backport.

Found a related ticket: Bug 622084 - Ctrl+C does not exit gtk app.

Mon, 11 May 2015 10:00:55 GMT - Antoine Martin: status changed; resolution set


Closing, hopefully for the last time.

Sat, 23 Jan 2021 05:01:16 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/626