Skip to content

Natural EOF registered for piped input with non-interactive output - #1736

Draft
Dom Giandinoto (daamenik) wants to merge 1 commit into
mainfrom
user/dgiandinoto/close-stdin-on-EOF-for-piped-output
Draft

Dom Giandinoto (daamenik) wants to merge 1 commit into
mainfrom
user/dgiandinoto/close-stdin-on-EOF-for-piped-output

Conversation

@daamenik

@daamenik Dom Giandinoto (daamenik) commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

📖 Description

🔗 References

Fixes #1678

🔍 Validation

✅ Checklist

  • Signed the Contributor License Agreement
  • Linked to an issue
  • For features or changes requiring a spec: linked the issue with maintainer-applied feature-accepted
  • For implementation: linked the required approved and merged design/API spec, or explained why no spec is required
  • Feature issue remains open unless this PR completes all agreed implementation, validation, and documentation
  • Updated documentation (if applicable)
  • Updated Copilot instructions (if build, architecture, or conventions changed)
  • If this PR changes Cargo.lock, the dependency-feed-check check passes (see pull request builds)

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

Copilot AI balanced review requested due to automatic review settings November 11, 2026 22:48
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Missing IsolationSession regressions leave the redirected-stdout hang unverified, while the documentation omits the unresolved Windows EOF limitation.

2 open issues
What changed in this PR

Addresses the MXC-side gap in #1678 by requesting IsolationSession stdin closure when pipe or file input ends and stdout is not a console.

Changes:

  • Distinguishes natural EOF from cancellation and invokes the close callback after releasing the relay’s writer.
  • Coordinates stdin closure with cleanup and adds diagnostic logging and unit tests.
  • Documents the behavior for create-and-run and relayed lifecycle execution.
File Description
src/​mxc-sdk/​src/​core/​mxc_common/​process_util.rs Exposes reader cancellation state to IsolationSession.
src/​mxc-sdk/​src/​backends/​isolation_session/​common/​pipe_relay.rs Adds EOF callbacks and tests for closure ordering, errors, cancellation, and panics.
src/​mxc-sdk/​src/​backends/​isolation_session/​common/​manager.rs Connects EOF to platform stdin closure with synchronization and diagnostics.
docs/​development/​architecture/​backends/​isolation-session/​state-aware-rust.md Describes EOF handling for relayed lifecycle execution.
docs/​development/​architecture/​backends/​isolation-session/​oneshot.md Documents EOF closure, diagnostics, and cleanup timing.

Review effort: Balanced

owned_thread::call(&impersonation, || {
let _close =
close_lock.lock().unwrap_or_else(PoisonError::into_inner);
process.CloseStandardInput().map_err(|error| {
Comment on lines +166 to +169
When stdin is a pipe or file and stdout is not a console, MXC closes the
workload's stdin when the input ends, so programs such as `sort.exe` can
finish instead of timing out. Console input and ConPTY behavior are unchanged.
Errors reported by this close operation go to configured diagnostic logs.

This branch has not been deployed

No deployments
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.

[IsolationSession] The stdin relay does not close the workload's stdin when its source ends

2 participants