Skip to content

Commit

Permalink
restart event loop to allow proper shutdown when there's an unhandled…
Browse files Browse the repository at this point in the history
… exception

Signed-off-by: William Woodall <william@osrfoundation.org>
  • Loading branch information
wjwwood committed Aug 30, 2018
1 parent 97edc9f commit b4969f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions launch/launch/launch_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ def _on_sigquit(signum, frame):
_logger.error(traceback.format_exc())
_logger.error(msg)
self._shutdown(reason=msg, due_to_sigint=False)
# restart run loop to let it shutdown properly
run_loop_task = self.__loop_from_run_thread.create_task(self.__run_loop())
finally:
# No matter what happens, unset the loop and set running to false.
with self.__loop_from_run_thread_lock:
Expand Down

0 comments on commit b4969f4

Please sign in to comment.