From a4000ee60fb4f26603ba310e5dcc4554b74426dd Mon Sep 17 00:00:00 2001 From: James Xu Date: Fri, 8 Feb 2019 15:06:51 -0800 Subject: [PATCH] respawn if process died while checking should_respawn() (#1590) * If process died when checking should_respawn, treat it as over-due and respawn (#32) * fix how the return value of should_respawn() is checked --- tools/roslaunch/src/roslaunch/pmon.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/roslaunch/src/roslaunch/pmon.py b/tools/roslaunch/src/roslaunch/pmon.py index 5550971b1c..9bd6411bc9 100644 --- a/tools/roslaunch/src/roslaunch/pmon.py +++ b/tools/roslaunch/src/roslaunch/pmon.py @@ -586,7 +586,9 @@ def _run(self): break #stop polling for d in dead: try: - if d.should_respawn(): + # when should_respawn() returns 0.0, bool(0.0) evaluates to False + # work around this by checking if the return value is False + if d.should_respawn() is not False: respawn.append(d) else: self.unregister(d)