Skip to content

Commit cc3f43a

Browse files
authored
[Spawner] Release the lock while waiting for the interrupt (#2559)
1 parent 7cbd0cc commit cc3f43a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

controller_manager/controller_manager/spawner.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ def main(args=None):
326326
if not unload_controllers_upon_exit:
327327
return 0
328328

329+
# The lock has to be released to not block other spawner instances while waiting for the interrupt
330+
lock.release()
329331
logger.info("Waiting until interrupt to unload controllers")
330332
while True:
331333
time.sleep(1)
@@ -381,7 +383,8 @@ def main(args=None):
381383
finally:
382384
if node:
383385
node.destroy_node()
384-
lock.release()
386+
if lock.is_locked:
387+
lock.release()
385388
rclpy.shutdown()
386389

387390

0 commit comments

Comments
 (0)