xpra icon
Bug tracker and wiki

Opened 3 years ago

Closed 23 months ago

#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 (9)

comment:1 Changed 3 years ago by Antoine Martin

Owner: changed from Antoine Martin to Antoine Martin
Status: newassigned
Summary: centos7 server does not run cleanups on SIGINTserver does not run cleanups on SIGINT from a console

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

comment:2 Changed 3 years ago by Antoine Martin

Keywords: centos7 removed
Resolution: worksforme
Status: assignedclosed

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 3 years ago by Antoine Martin

Resolution: worksforme
Status: closedreopened

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.

Last edited 3 years ago by Antoine Martin (previous) (diff)

comment:4 Changed 2 years ago by Antoine Martin

Resolution: fixed
Status: reopenedclosed

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 2 years ago by Antoine Martin

Resolution: fixed
Status: closedreopened

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:6 Changed 23 months ago by Antoine Martin

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

comment:7 Changed 23 months ago by 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)

comment:8 Changed 23 months ago by 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.

Last edited 23 months ago by Antoine Martin (previous) (diff)

comment:9 Changed 23 months ago by Antoine Martin

Resolution: fixed
Status: reopenedclosed

Backports:

Closing, hopefully for the last time.

Note: See TracTickets for help on using tickets.