Repository navigation
Fix stdin relay for pipes in IsoSession - #1450
Draft
Dom Giandinoto (daamenik) wants to merge 1 commit into
Draft
Dom Giandinoto (daamenik) wants to merge 1 commit into
Dom Giandinoto (daamenik) wants to merge 1 commit into
Conversation
… changed from just relying on interactive trait of stdout
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Dom Giandinoto (daamenik)
marked this pull request as draft
October 8, 2026 08:11
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Natural stdin EOF is not propagated to workloads that read until EOF, potentially causing an indefinite wait.
1 open finding
What changed in this PR
Fixes IsolationSession stdin relay selection for redirected pipe/file input.
Changes:
- Classifies stdin by its actual Windows handle type.
- Uses cancellable relays for pipe/file stdin.
- Adds cancellation and destination-handle release coverage.
| File | Description |
|---|---|
pipe_relay.rs |
Documents redirected-stdin behavior and tests cancellation cleanup. |
manager.rs |
Selects and tears down stdin relays by handle type. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
Comment on lines
+599
to
+605
| StdinRelayKind::CancellablePipe => { | ||
| let (thread, canceller) = unsafe { | ||
| create_relay_thread( | ||
| wxc_stdin, | ||
| HANDLE(stdin_handle_val as *mut core::ffi::c_void), | ||
| ) | ||
| } |
This branch has not been deployed
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.

📖 Description
For a given sandbox, relays copy stdin bytes to the sandbox and stdout/stderr bytes back. There are two stdin relay types: a console-oriented one that listens for a stop event, and a pipe-oriented one that runs until EOF or until a cancel switch is fired.
The isolation_session backend chose the stdin relay type from the interactivity of stdout, not stdin. So piped input was handed the stop-aware console relay instead of the pipe-friendly one. Two consequences:
This change classifies the stdin handle at runtime and routes pipe/file stdin to the cancellable pipe relay, so piped I/O works and the destination handle is released on teardown.
🔗 References
🔍 Validation
Manual repro (console stdout + piped stdin): before = no output, ~30s hang, non-zero exit; after = input echoed, prompt exit 0
'HELLO FROM CALLER' | .\wxc-exec.exe --experimental $config 2>&1 ; "EXIT=$LASTEXITCODE"✅ Checklist
Cargo.lock, thedependency-feed-checkcheck passes (see pull request builds)📋 Issue Type
GitHub Actions runs the PR validation build automatically. The ADO pipeline
(
MXC-PR-Build) is the Azure version of the PR pipeline, kept in parity with the GitHubActions build; it runs on merge to
main, and Microsoft reviewers with write access can trigger iton a PR with
/azp run. See pull request builds.If the
dependency-feed-checkcheck fails on a new dependency, the crate must be added tothe feed before the PR can pass. See pull request builds
for the steps.