Return Code not set on SIGINT
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 155
- Forks
- 182
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 6
Description
Bug report
- Operating System:
- Ubuntu 20.04
- Installation type:
- binaries
- Version or commit hash:
- foxy
- Client library (if applicable):
- N/A
Steps to reproduce issue
from launch import LaunchDescription
from launch.actions import ExecuteProcess
def generate_launch_description():
ld = LaunchDescription()
ld.add_action(ExecuteProcess(cmd=['sleep', '5']))
return ld
Expected behavior
- If you run the command
sleep 5normally, it has return code 0. - If you run it and hit CtrlC, it has the return code 130.
- If you launch the above lunch file normally, it has the return code 0.
- If you run it and hit CtrlC, I expect it to return some non-zero code.
Actual behavior
In actuality, it also returns 0.
Additional information
The return code for launch is set on exceptions but the sigint handler does not set the return code and shutsdown the processes "normally".
The best workaround I came up with is an OnShutdown event handler with an OpaqueFunction to save the value of event.reason but that doesn't seem great.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with launch/launch/launch_service.py, especially the SIGINT handler and the exception-based return-code handling linked in the issue. Reproduce the provided ExecuteProcess example on Ubuntu 20.04 with Ctrl-C, then verify that launch exits with a non-zero return code instead of 0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100