#626 closed defect (fixed)
server does not run cleanups on SIGINT from a console
Reported by: | Antoine Martin | Owned by: | Antoine Martin |
---|---|---|---|
Priority: | critical | Milestone: | 0.15 |
Component: | platforms | Version: | trunk |
Keywords: | Cc: |
Description
Calling xpra stop
(or even xpra exit
) cause the cleanups to run, but when sending a SIGINT
(ie: control-C) they don't...
Change History (10)
comment:1 Changed 6 years ago by
Owner: | changed from Antoine Martin to Antoine Martin |
---|---|
Status: | new → assigned |
Summary: | centos7 server does not run cleanups on SIGINT → server does not run cleanups on SIGINT from a console |
comment:2 Changed 6 years ago by
Keywords: | centos7 removed |
---|---|
Resolution: | → worksforme |
Status: | assigned → closed |
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.
comment:3 Changed 6 years ago by
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
This change was breaking profiling and has been reverted in r7181.
We need a solution that:
- guarantees we always run the exit callbacks (usual case)
- runs the cleanups in the UI thread (see #582)
- allows us to return from main() without calling them..
- works with a console or regular terminal..
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.
comment:4 Changed 6 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
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)
comment:5 Changed 6 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
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?
comment:7 Changed 6 years ago by
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)
comment:8 Changed 6 years ago by
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.
comment:9 Changed 6 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:10 Changed 33 hours ago by
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/626
Edited title: this only occurs when running from a console, not from an xterm!??? (also affects Fedora 20 and probably others too)