Skip to content

Retry daemon socket acquisition after shutdown tail - #1274

Open
sylvesterkaczmarek wants to merge 1 commit into
ros2:rollingfrom
sylvesterkaczmarek:fix-1229-daemon-socket-retry
Open

Retry daemon socket acquisition after shutdown tail#1274
sylvesterkaczmarek wants to merge 1 commit into
ros2:rollingfrom
sylvesterkaczmarek:fix-1229-daemon-socket-retry

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Aug 20, 2026

Copy link
Copy Markdown

Summary

Addresses the remaining failure mode in #1229.

shutdown_daemon() now waits for the XML-RPC address to become reusable, but a daemon that exits through its inactivity timeout can still stop serving before the process releases the listening socket. During that window, spawn_daemon() currently interprets EADDRINUSE as an already-running daemon and returns False.

When a spawn timeout is provided, distinguish that shutdown-tail case from a live daemon, wait for the address to become reusable, and retry the bind once.

Existing behavior is preserved when:

  • a live daemon is actually running
  • no spawn timeout was requested
  • another process wins the bind race

Testing

Added focused unit tests for:

  • an address owned by a live daemon
  • a temporarily busy shutdown-tail address
  • existing non-blocking behavior without a timeout

Did you use Generative AI?

Yes. AI was used to assist with tests.

Distinguish a live daemon from a temporarily occupied daemon address. When a spawn timeout is provided and the daemon is no longer serving, wait for the address to become reusable and retry the bind once.

Add focused tests for live-daemon, shutdown-tail, and non-blocking behavior.

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
@mergify

mergify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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