Repository navigation
[WSLC] Always warn when a stdin flood may have lost a command's output - #1620
Merged
Soham Das (SohamDas2021) merged 1 commit intoOct 30, 2026
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
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
The callback-delay check measures time spent in wait() rather than exit-to-callback latency, so it can miss late callbacks and associated output loss when callers drain output before waiting.
1 open issue
What changed in this PR
This follow-up to #1564 addresses intermittent missing warnings after WSLc stdin floods, reported in #1605, without changing public APIs or schemas.
Changes:
- Uses a 10-second callback-wait threshold instead of requiring the 30-second wait to expire.
- Extends the stdin-flood regression command to exercise the minimum observed late-exit delay.
- Corrects documentation to describe exit reporting as delayed by 30 seconds or more.
| File | Description |
|---|---|
tests/scripts/run_wslc_all_tests.ps1 |
Runs the flood command for 40 seconds with a 120-second execution timeout. |
src/mxc-sdk/src/backends/wslc/common/wsl_container_runner.rs |
Adds elapsed-time detection for the potentially incomplete-output warning. |
docs/backends/wslc/wsl-container-getting-started.md |
Corrects the documented delay caused by unread stdin. |
Review effort: Balanced
| // below may leak the context, since the SDK can call back late. | ||
| let mut confirmed = io_ctx.wait_for_exit_callback(); | ||
| let callback_late = !confirmed; | ||
| let callback_late = exit_seen.elapsed() >= LATE_EXIT_THRESHOLD; |
Branden Bonaby (bbonaby)
approved these changes
Oct 30, 2026
Soham Das (SohamDas2021)
deleted the
sohamdas2021-wslc-stdin-flood-flake
branch
October 30, 2026 01:15
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
When a WSLc command exits without reading a large amount of its stdin, the WSLc SDK sometimes drops the command's output and reports its exit 30 s or more late. MXC warned only when that report took longer than its own 30 s wait, so when the SDK reported exactly 30 s late, a few milliseconds decided whether the warning appeared. On some hosts it didn't, and output was lost with no warning.
sleep 40instead ofsleep 3. A command that ends that long after its input backs up is reported exactly 30 s late, the delay the old check could miss.MXC cannot stop the SDK from dropping the output; it can only warn that this may have happened. No spec is needed: this is a bug fix with no change to the API or schema.
🔗 References
Fixes #1605. Follow-up to #1564. This edits the same part of
wsl_container_runner.rsas #1597, so whichever merges second needs a small rebase.🔍 Validation
Windows with WSL 3.0.4.0 (the same version as the CI hosts) and WSLc SDK 3.0.3.
cargo fmt --all -- --checkcargo clippy -p mxc-sdk --features wslc --all-targets -- -D warningscargo test -p mxc-sdk --features wslc --lib -- wslcwxc-exec, before the fix (6 runs)Not run: the full
run_wslc_all_tests.ps1suite and the .NET and Node live WSLc tests.✅ Checklist
feature-acceptedCargo.lock, thedependency-feed-checkcheck passes (see pull request builds)📋 Issue Type
Microsoft Reviewers: Open in CodeFlow