Commit c24c73a
committed
fix: retry PTY drain on empty select() to prevent data loss on macOS
The PTY drain logic in read_pty_output's finally block broke out of the
drain loop after a single empty select() poll (100ms). On macOS CI
runners under load (make test -j4 with concurrent package installs),
PTY kernel buffer delivery can be delayed beyond 100ms after subprocess
exit, causing the drain to miss the output entirely.
Replace the immediate break with a consecutive empty poll counter that
requires 3 empty select() calls (~300ms) before concluding the drain is
complete. This extends the tolerance window while still respecting the
existing DRAIN_TIMEOUT_SECONDS (2s) and MAX_DRAIN_BYTES limits.
Isolated reproduction confirms:
- Original: 0/20 pass rate when data arrives >100ms after drain starts
- Fixed: 20/20 pass rate for delays up to 250ms+
Fixes #8211 parent a3bcb14 commit c24c73a
37 files changed
Lines changed: 9509 additions & 2 deletions
File tree
- .agentready
- controller
- deploy/operator
- bundle
- manifests
- metadata
- tests/scorecard
- contribute
- internal/service/configwatch
- python
- packages
- jumpstarter-driver-sdwire/examples
- jumpstarter/jumpstarter/exporter
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments