Skip to content

Fix lifecycle manager deadlock during shutdown (backport #5438)#5440

Merged
SteveMacenski merged 1 commit intokiltedfrom
mergify/bp/kilted/pr-5438
Aug 11, 2025
Merged

Fix lifecycle manager deadlock during shutdown (backport #5438)#5440
SteveMacenski merged 1 commit intokiltedfrom
mergify/bp/kilted/pr-5438

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Aug 11, 2025

This PR fixes the lifecycle manager deadlock issue described in #5437.

Changes

  • Add stop() method to ServiceClient that cancels internal executor operations
  • Call stop() in LifecycleServiceClient destructor to prevent deadlock

Problem Addressed

When CTRL+C is pressed during lifecycle node bringup, a race condition can cause spin_until_future_complete to hang indefinitely as bringup and shutdown sequences run concurrently.

Solution

The stop() method cancels any running spin operations on the internal executor, allowing proper shutdown coordination.

Closes #5437

Generated with Claude Code


This is an automatic backport of pull request #5438 done by Mergify.

* Fix lifecycle manager deadlock during shutdown

Add stop() method to ServiceClient that cancels internal executor operations
and call it in LifecycleServiceClient destructor to prevent deadlock when
CTRL+C is pressed during lifecycle node bringup.

This addresses issue #5437 where spin_until_future_complete can hang
indefinitely during shutdown when bringup and shutdown sequences run
concurrently.

Co-authored-by: Steve Macenski <SteveMacenski@users.noreply.github.com>

* Update service_client.hpp

Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>

---------

Signed-off-by: Steve Macenski <stevenmacenski@gmail.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
(cherry picked from commit f7b6654)
@mergify
Copy link
Contributor Author

mergify bot commented Aug 11, 2025

@mergify[bot], all pull requests must be targeted towards the main development branch.
Once merged into main, it is possible to backport to @kilted, but it must be in main
to have these changes reflected into new distributions.

@SteveMacenski SteveMacenski merged commit 09d72e7 into kilted Aug 11, 2025
8 of 10 checks passed
@SteveMacenski SteveMacenski deleted the mergify/bp/kilted/pr-5438 branch August 11, 2025 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant