Skip to content

ssh: Keep daemon alive while replacing options - #11408

Closed
sbarvick-dd wants to merge 1 commit into
erlang:maint-27from
sbarvick-dd:ssh-daemon-replace-options-race-27
Closed

ssh: Keep daemon alive while replacing options#11408
sbarvick-dd wants to merge 1 commit into
erlang:maint-27from
sbarvick-dd:ssh-daemon-replace-options-race-27

Conversation

@sbarvick-dd

Copy link
Copy Markdown

In OTP 27, daemon_replace_options/2 uses
ssh_system_sup:replace_acceptor_options/2 to temporarily remove the daemon's acceptor supervisor while replacing the listening socket and its options.

If the final active SSH connection terminates during this interval, ssh_system_sup can have no remaining significant children. Its all_significant auto-shutdown policy then stops the daemon before the replacement acceptor is started, causing the operation to exit with noproc.

Add a temporary significant guard child around OTP 27's acceptor replacement path. The guard keeps ssh_system_sup alive until the new acceptor is running and is always removed afterward, preserving the daemon's normal shutdown behavior outside the replacement window.

Add a deterministic Common Test case that pauses replacement after the listener is stopped, closes the final connection, and verifies that daemon_replace_options/2 succeeds, the daemon remains alive, and its information remains available.

The test reproduced the noproc failure before rebuilding SSH with the fix and passed after the patched SSH application was rebuilt.

In OTP 27, daemon_replace_options/2 uses
ssh_system_sup:replace_acceptor_options/2 to temporarily remove the
daemon's acceptor supervisor while replacing the listening socket and
its options.

If the final active SSH connection terminates during this interval,
ssh_system_sup can have no remaining significant children. Its
all_significant auto-shutdown policy then stops the daemon before the
replacement acceptor is started, causing the operation to exit with
noproc.

Add a temporary significant guard child around OTP 27's acceptor
replacement path. The guard keeps ssh_system_sup alive until the new
acceptor is running and is always removed afterward, preserving the
daemon's normal shutdown behavior outside the replacement window.

Add a deterministic Common Test case that pauses replacement after the
listener is stopped, closes the final connection, and verifies that
daemon_replace_options/2 succeeds, the daemon remains alive, and its
information remains available.

The test reproduced the noproc failure before rebuilding SSH with the
fix and passed after the patched SSH application was rebuilt.
@github-actions

Copy link
Copy Markdown
Contributor

CT Test Results

Tests are running... https://github.com/erlang/otp/actions/runs/30563450909

Results for commit 2d0a10c

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

  • No CT logs found
  • No HTML docs found
  • No Windows Installer found

// Erlang/OTP Github Action Bot

@Mikaka27 Mikaka27 self-assigned this Jul 30, 2026
@Mikaka27 Mikaka27 added the team:PS Assigned to OTP team PS label Jul 30, 2026
@sbarvick-dd

Copy link
Copy Markdown
Author

Sorry, I could have done that for you. I was starting with 27 to see if I got through that. Thanks

@Mikaka27

Mikaka27 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Sorry, I could have done that for you. I was starting with 27 to see if I got through that. Thanks

No worries, thanks for creating the branch. I will close this PR in favor of #11399, since maint-XX branches are not development branches, so we will not merge anything there. Your branch will be merged as part of the release process (when next patch release is created), but this PR is not required, we only need the branch.

Thanks :)

@Mikaka27 Mikaka27 closed this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:PS Assigned to OTP team PS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants