Skip to content

[bug] Pipeline consumer read -t timeout discards not-yet-arrived data for later reads (shell-form producer) #1581

Closed

Description

@caomengxuan666

Summary

When a pipeline's producer is a shell-form (compound) stage, a consumer-side read -t that times out causes the stream to be treated as finished: a subsequent read loses data that had not yet arrived. With an all-external producer the same script behaves correctly, so the seam is in the materialization + production-timetable path, not in read itself.

Regression seed

{ sleep 1; echo A; } | { read -t 0.3 x; echo "early_rc=$?"; read y; echo "got=$y"; }

Measured (Linux, debug build of master ec279df tree vs self-compiled GNU bash 5.3.20)

  • GNU: early_rc=142, got=A.
  • rubash: early_rc=142, got= (empty — the late line is lost).

Control: the same shape with an all-external producer yields got=A on both shells.

Mechanism candidate (from the executor architecture audit)

Default pipelines do not run concurrently; byte arrival times are modeled by a production timetable (timed_input) that adjudicates read -t timeouts. The timetable rules the timeout but also appears to finalize the stream, discarding not-yet-arrived bytes for subsequent reads.

Distinct from #1206 (read -t ignored on pipe stdin), #1209 (-n/-t interplay with a bare echo producer) and #398 (read -t 0 consuming pending input).

Source: executor architecture audit (arch-audit B, candidate C1), probe p1_readt.sh (+ p1b control), double-run on oracle and current build.

Activity

  1. added
    area:read
    bug
    gnu-baseline
    on Oct 26, 2026
  2. added a commit that references this issue on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:readbuggnu-baseline

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions