Skip to content

Commit bed9e5e

Browse files
authored
fix(supervisor): use better error message when sandbox connect is not available (#3572)
* fix(supervisor): explain unavailable main terminal attachments Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(supervisor): reset cursor after terminal attachment errors Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(supervisor): format read-only warnings for terminal clients Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * docs: drop terminal attachment documentation additions Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * fix(supervisor): exit read-only viewers on Ctrl-C Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> * docs: simplify read-only viewer Ctrl-C guidance Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> --------- Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent f3e097d commit bed9e5e

6 files changed

Lines changed: 360 additions & 28 deletions

File tree

‎architecture/sandbox.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,9 @@ sandbox workload directly. The relay supports:
648648

649649
- Attachment to the canonical main process through the `openshell-main` SSH
650650
subsystem. The supervisor owns its retained PTY or pipes, a 1 MiB replay
651-
buffer, and a single stdin lease across client disconnects.
651+
buffer, and a single stdin lease across client disconnects. Ctrl-C interrupts
652+
the foreground process. For read-only attachments, Ctrl-C only exits the
653+
current viewer.
652654
- Independent interactive shell sessions.
653655
- Command execution. Commands run through a login shell (`bash -lc`) by default,
654656
so the first of the user's `.bash_profile`, `.bash_login`, or `.profile` is

‎crates/openshell-supervisor-process/src/main_session.rs‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,13 @@ impl MainSession {
211211
const REMOTE_OUTPUT_DRAIN_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(2);
212212
#[cfg(test)]
213213
pub fn inert() -> Arc<Self> {
214-
let (input, _input_rx) = tokio::sync::mpsc::channel(64);
215-
Arc::new(Self {
214+
Self::inert_with_input().0
215+
}
216+
217+
#[cfg(test)]
218+
pub fn inert_with_input() -> (Arc<Self>, tokio::sync::mpsc::Receiver<Vec<u8>>) {
219+
let (input, input_rx) = tokio::sync::mpsc::channel(64);
220+
let session = Arc::new(Self {
216221
pid: 1,
217222
terminal: false,
218223
input,
@@ -231,7 +236,8 @@ impl MainSession {
231236
expectation: AttachmentExpectation::None,
232237
}),
233238
terminal_attachments_done: Notify::new(),
234-
})
239+
});
240+
(session, input_rx)
235241
}
236242

237243
#[cfg(test)]

0 commit comments

Comments
 (0)