Repository navigation
Guard more effectively against stdout truncation - #1520
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
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Synchronous warning delivery can block indefinitely on full stderr after bounded relay cleanup.
1 open issue
What changed in this PR
This PR reduces output truncation in IsolationSession relayed execution by extending draining while output continues.
Changes:
- Track relay progress with idle and overall drain limits.
- Report possible truncation through warnings.
- Add drain tests and document cancellation limitations.
| File | Description |
|---|---|
src/mxc-sdk/src/core/mxc_common/process_util.rs |
Document cancellation-related data loss. |
src/mxc-sdk/src/backends/isolation_session/common/state_aware.rs |
Forward relayed-execution warnings to stderr and test reporting. |
src/mxc-sdk/src/backends/isolation_session/common/pipe_relay.rs |
Implement progress-aware draining and tests. |
src/mxc-sdk/src/backends/isolation_session/common/manager.rs |
Integrate bounded draining into relay cleanup. |
docs/development/architecture/backends/isolation-session/state-aware-rust.md |
Explain drain limits and warning behavior. |
Review effort: Balanced
| mut stderr: impl Write, | ||
| ) -> Result<ExecHandle, MxcError> { | ||
| for warning in logger.warnings() { | ||
| writeln!(stderr, "{warning}").map_err(|error| { |
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
Before this PR, we were draining stdout and stderr based on a fixed, short timeout, not based on the continuity of output. This PR adds a mechanism to allow for longer output draining based on if bytes are still coming in through the agent output read, checking for idle pipes periodically over a longer absolute timeout, and stopping before the timeout if no more data is coming through.
🔗 References
🔍 Validation
✅ 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.
Microsoft Reviewers: Open in CodeFlow