-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExecuteProcess
with shell=True
gets incorrect exit code from the executed process
#757
Comments
ExecuteProcess
with shell=True
gets incorrect exit code the exceuted processExecuteProcess
with shell=True
gets incorrect exit code from the executed process
Hello, Required Info: If I take the same example as you when I run the launch file with ps -aux | pgrep -f test.py I can see two pid, as if the process was launched twice. user 159666 0.0 0.0 2896 1600 pts/0 S+ 09:22 0:00 /bin/sh -c python3 ./test.py
user 159668 0.2 0.0 22608 9440 pts/0 S+ 09:22 0:00 python3 ./test.py Maybe it's totally normal, but the thing is when I called that same launch through another launch file (that I will call main.launch.py) where I add : event_handlers.append(
RegisterEventHandler(
event_handler=OnProcessExit(
target_action=onenode,
on_exit=[EmitEvent(event=Shutdown())],
)
)
) That allows me to shutdown all the process launched by main.launch.py whenever one particular node is shutting down Expected behavior Actual behavior If you don't think that is related, i will ask in another ticket. BR, Alexis |
It looks like the signal is actually not propagated to the subprocess properly. This might actually be the root cause of the problem. |
Bug report
Required Info:
Steps to reproduce issue
Create
test.py
In the same directory, create
test.launch.py
Run
ros2 launch test.launch.py
. After a few seconds, typeCtrl-C
.Expected behavior
The
test.py
process to exit cleanly.Actual behavior
It shows an error saying the process has died
Additional information
Running
python3 test.py
itself and interrupting withCtrl-c
results in a0
exit code, so it's not clear why the behavior is different when run throughlaunch
. This also only happens ifshell=True
. Whenshell=False
or omitted, I getThe text was updated successfully, but these errors were encountered: