Skip to content

Commit 4ded088

Browse files
committed
Remove signal handler for SIGQUIT.
SIGQUIT signals are often generated by the user hitting 'CTRL+\' in an interactive shell. However, when the terminal driver receives those characters, it doesn't just send a SIGQUIT to the running process, but to the entire foreground process group. By default, the ROS2 Client Libraries don't register a handler for SIGQUIT, as they do for SIGINT and SIGTERM, so the ROS2 node will be terminated immediately and its core dumpted on receipt. So there is little reason for ROS2 Launch to catch this signal for the purposes of forwarding it on to its children. Also, not catching SIGQUIT means that if there is a problem with the Python signal handling, then the user still has available a shortcut on their keyboards to unilaterally kill the process. Signed-off-by: <[email protected]> Signed-off-by: Cian Donovan <[email protected]>
1 parent c5ff7d4 commit 4ded088

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

launch/launch/launch_service.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def _prepare_run_loop(self):
185185
this_task = asyncio.Task.current_task(this_loop)
186186

187187
self.__this_task = this_task
188-
# Setup custom signal handlers for SIGINT, SIGTERM and maybe SIGQUIT.
188+
# Setup custom signal handlers for SIGINT & SIGTERM
189189
sigint_received = False
190190

191191
def _on_sigint(signum):
@@ -214,8 +214,6 @@ def _on_sigterm(signum):
214214
# Setup signal handlers
215215
manager.handle(signal.SIGINT, _on_sigint)
216216
manager.handle(signal.SIGTERM, _on_sigterm)
217-
if platform.system() != 'Windows':
218-
manager.handle(signal.SIGQUIT, _on_sigterm)
219217
# Yield asyncio loop and current task.
220218
yield this_loop, this_task
221219
finally:

0 commit comments

Comments
 (0)