Commit 733db6b
authored
ci: avoid SIGPIPE in e2e-failure-analyzer awk pipeline (#13702)
## Summary
Follow-up to #13693. That PR replaced `grep | grep | head -1` with a
single awk pipeline to avoid `head` closing its stdin and SIGPIPE-ing
upstream `grep`. But the new awk script kept the same shape of bug: it
calls `exit` after the first match, which closes awk's stdin and
SIGPIPEs the upstream `printf`. Under `set -e -o pipefail` the step
still dies.
posit-dev/positron-builds CI confirms this with `printf: write error:
Broken pipe` on real job logs. Small local logs don't reproduce because
`printf` finishes writing before awk's `exit` closes the pipe.
Fix: rewrite the awk script as an END-block accumulator. awk reads all
input, captures the first concrete match into a variable, prints it at
END. No early termination, no pipe-close race.
The trade-off is reading the whole log instead of bailing on the first
match. `gh api .../jobs/$ID/logs` payloads are bounded (~10MB max), so
the cost is negligible compared to eliminating the race for good.
## Test plan
- [ ] Trigger `analyze-e2e-failures.yml` on positron — should still work
end-to-end (the awk script's external behavior is unchanged: prints the
first concrete match or nothing).
- [ ] positron-builds end-to-end will validate the SIGPIPE doesn't recur
on real CI log sizes once positron-builds bumps to this SHA.1 parent 8eaf5d9 commit 733db6b
1 file changed
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
163 | 163 | | |
164 | | - | |
165 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
166 | 170 | | |
167 | 171 | | |
168 | 172 | | |
| |||
0 commit comments