Skip to content

Commit

Permalink
respawn if process died while checking should_respawn() (ros#1590)
Browse files Browse the repository at this point in the history
* If process died when checking should_respawn, treat it as over-due and respawn (ros#32)

* fix how the return value of should_respawn() is checked
  • Loading branch information
kejxu authored and tahsinkose committed Apr 15, 2019
1 parent 7406ae0 commit a4000ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/roslaunch/src/roslaunch/pmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a4000ee

Please sign in to comment.