Add process listeners to XML RPC server instance#1267
Add process listeners to XML RPC server instance#1267luator wants to merge 1 commit intoros:kinetic-develfrom luator:kinetic-fix-remote-proc-listeners
Conversation
When a process on a remote machine dies, the `process_died` callback of the server is called. However, the process listeners given to `ROSLaunchParent` need to be forwarded to the server, otherwise they cannot be called.
|
Can you please provide a reproducible example how you have tested the patch. |
|
This contains a package with a minimal working example: test_remote_monitoring.tar.gz How to useAdapt the launch file to run the stuff on a remote machine, then start it with The monitor node runs the launch file (starting two nodes node1 and node2) and registers a ProcessListener that prints a warning whenever a node died. The launch file starts two dummy nodes, node1 and node2. Now kill the nodes one after another by calling: OutputWhen launching locally--> Warning is printed for each node. When launching on remote machine--> Warning is not printed when the first node is killed. Only after the second one is killed, there is one for the whole launch file. None for the individual nodes, though. When launching on remote machine with fix of this PR--> Now there are warnings for the individual nodes as soon as they are killed. |
|
Thank you for the patch. I will close this in favor of #1319 which only difference is that it targets the |
I recently noticed a bug in the roslaunch API: When I pass a ProcessListener to ROSLaunchParent, it should be called whenever a node that was launched with it dies. However, this was not working for nodes that are launched on a remote machine. See corresponding question on ROS Ansers.
I digged into the code and found out that the callback calls are already forwarded to the server, but on the server side there are multiple objects holding a list of ProcessListeners that is not properly synchronized, i.e. the instance that receives the callback call from the remote machine does not have the listeners that were passed to the ROSLaunchParent.
The change I propose fixes this (at least it is working well for me now). However, as the code is quite complicated and I don't have a complete oversight of what is going on there, I would be grateful if someone with a better understanding could check this to make sure there are no undesired side effects.
The PR is based on kinetic-devel as I currently do not have a setup to test with lunar.