Repository navigation
fix(supervisor): terminate orphaned non-main processes when ssh connection drops (#4946) - #5009
Closed
Mohit20057 wants to merge 1 commit into
Closed
Mohit20057 wants to merge 1 commit into
Mohit20057 wants to merge 1 commit into
Conversation
…ction drops When an SSH connection drops abruptly (e.g. client killed, network drop, or client computer sleeping), channels are dropped without russh invoking channel_close. Previously, SshHandler::drop only detached the main session and ignored non-main processes stored in ChannelState.process. This caused active shell and exec processes to remain running inside the sandbox boundary reparented to PID 1, eventually accumulating until subsequent exec requests failed with 'failed to start boundary exec'. Update SshHandler::drop to iterate over all active channels, clean up pending input tasks, and asynchronously terminate any lingering non-main boundary processes while preserving the reconnectable main session. Closes NVIDIA#4946 Signed-off-by: Mohit20057 <mohitnehete6@gmail.com>
|
Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text: I have read the DCO document and I hereby sign the DCO. You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot. |
|
Thank you for your interest in contributing to OpenShell, @Mohit20057. This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer. To get vouched:
See CONTRIBUTING.md for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an issue where unexpectedly dropped SSH connections (client process kill, network loss, laptop sleep) leave behind orphan shell and exec processes in the sandbox boundary. Over time, these orphaned processes accumulated until subsequent exec requests failed.
Related Issue
Closes #4946
Changes
SshHandler::dropincrates/openshell-supervisor-process/src/ssh.rsto iterate over active channels and asynchronously terminate any lingering non-main processes (state.process.take()).MainSessionattachment semantics so main sessions survive client disconnects.dropped_ssh_session_terminates_in_flight_execinexec_input_tests.rs.Release Notes
Terminate orphaned in-boundary exec and shell processes when an SSH connection severs unexpectedly, preventing sandbox resource exhaustion.
Testing
Checklist