Skip to content

gmoccapy: exit on SIGTERM/SIGINT regardless of main-loop state#4115

Open
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:fix/gmoccapy-sigterm-robust
Open

gmoccapy: exit on SIGTERM/SIGINT regardless of main-loop state#4115
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:fix/gmoccapy-sigterm-robust

Conversation

@grandixximo
Copy link
Copy Markdown
Contributor

gmoccapy did not reliably exit on SIGTERM; callers had to escalate to SIGKILL.

#4076 routed the signal through excepthook to Gtk.main_quit(), but that only quits while Gtk.main() is iterating. A signal arriving during startup, or while a nested dialog is up, hits gtk_main_quit: assertion 'main_loops != NULL' and gmoccapy keeps running.

This installs an explicit SIGTERM/SIGINT handler that quits the loop if one is active, otherwise exits the process. Surfaced by the ui-smoke quit-path tests (#4054).

The KeyboardInterrupt-via-excepthook path only quits while Gtk.main()
is iterating; a signal during startup or a nested dialog hits
'gtk_main_quit: assertion main_loops != NULL' and gmoccapy runs on
until SIGKILL. Install an explicit handler that quits the loop if one
runs, else exits the process.
@grandixximo
Copy link
Copy Markdown
Contributor Author

@andypugh need merge this too, then the smoke test phase 2 should pass, I think 🤔

@grandixximo
Copy link
Copy Markdown
Contributor Author

@BsAtHome when you have a moment, could you take a look at this one? It is the gmoccapy half of the SIGTERM cleanup; #4076 only quits while the Gtk main loop is iterating, so a signal during startup or a nested dialog hits gtk_main_quit: assertion 'main_loops != NULL' and the process runs on until SIGKILL. This adds an explicit handler that exits regardless of loop state. It is the last fix blocking the ui-smoke phase-2 quit tests in #4054.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant