Runner: preserve complete guest output when file writes are short - #942
Closed
brandonpayton wants to merge 1 commit into
Closed
Runner: preserve complete guest output when file writes are short#942brandonpayton wants to merge 1 commit into
brandonpayton wants to merge 1 commit into
Conversation
Member
Author
|
Absorbed by rebase-merged #967. Main is now 6efb411 with the sealed tree b133bfa018f7e2bc84c4845edf2f945b2f844954, and ABI 41 activation completed successfully in run 29550069085. The absorption audit confirmed this PR\x27s behavior and tests are present in that merged tree, so this source PR is closed and its branch is deleted. |
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.
Why
A short write is a successful operating-system write that stores only part of the requested buffer. Callers must retry with the remaining bytes or they silently lose data.
The generic Node example runner can capture guest stdout and stderr in a file. A successful file write is allowed to write fewer bytes than requested, but the runner treated every successful call as if it had written the complete buffer. Under a short write, the tail of guest output could be lost.
Root cause
The runner called
writeSynconce and ignored its returned byte count.What changed
Add a small
writeAllSynchelper that:The guest-output callback now uses this helper whenever file capture is enabled.
Validation
git diff --checkpassed.ABI
No ABI change. This is generic Node runner I/O behavior and does not change any kernel, host-worker, package, or Wasm interface.