Repository navigation
fix(pipeline): honor read -t deadline against delayed subshell producers - #1291
Merged
Merged
Conversation
…rubash#1206)
`(sleep 2; echo late) | { read -t 1 x; }` waited out the producer and
consumed the late line with status 0 — the -t deadline never applied to
pipe input. execute_timed_read_pipeline already models producer timing
for `{ ...; }` bodies; a `( ... )` subshell producer declined the fast
path and fell back to the sequential stage loop where the deadline was
armed after the data had arrived. Walk subshell_command bodies the same
way so an expired deadline reports 128+SIGALRM (142).
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Fixes #1206
Summary
(sleep 2; echo late) | { read -t 1 x; }waited ~2s for the producer and consumedlatewithrc=0;(sleep 3) | { read -t 1; }returnedrc=1only when the pipe closed.execute_timed_read_pipeline) models producer timing, but only walked{ ...; }brace-group bodies — a( ... )subshell producer declined and fell back to the sequential stage loop where the deadline armed after data had already arrived.timed_pipeline_inputnow walkssubshell_commandbodies the same way.Before:
rc=0 x=[late]/rc=1 y=[]After:
rc=142 x=[]/rc=142 y=[](matches GNU 5.3.20; read returns at ~1s, not the producer's ~3s)Test plan
tests/issue1206_read_timeout_pipe.rs(4 cases vs WSL GNU Bash 5.3.20)cargo fmtcleanGenerated with Devin