[
https://issues.apache.org/jira/browse/CAMEL-24777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18121429#comment-18121429
]
Claus Ibsen commented on CAMEL-24777:
-------------------------------------
Still happening, but I think the source is now a different pipe from the one
first suspected: {{sort | head}} in {{reactor_timing.sh}}, not stdout being
truncated.
Seen on PR 27150 and PR 27147 (2026-09-30). In both, Maven finished with exit
code 0, and the job failed about 30 seconds later:
{noformat}
Maven build completed with exit code: 0
recovered flaky tests: 5
sort: fflush failed: 'standard output': Broken pipe
sort: write error
##[error]Process completed with exit code 2.
{noformat}
https://github.com/apache/camel/actions/runs/36757859655/job/110032576984
https://github.com/apache/camel/actions/runs/36762046197/job/110047205564
{{.github/actions/incremental-build/reactor_timing.sh}},
render_top_slowest_modules (line 139):
{noformat}
... | sort -t $'\t' -k1,1nr | head -n "$limit" | while ...
{noformat}
{{head}} exits after {{$limit}} lines. Because {{trap '' PIPE}} (the earlier
fix for this issue) makes SIGPIPE ignored, {{sort}} is not killed when it
writes into the closed pipe: it gets EPIPE, prints "write error" and exits 2.
The script is sourced under {{set -euo pipefail}}, so that exit 2 fails the
step even though the build passed. It only happens when the reactor log has
enough modules that {{sort}} is still writing when {{head}} closes, which is
why it is intermittent and shows up on larger builds.
Possible fix: let the limiting step read all its input, e.g.
{noformat}
... | sort -t $'\t' -k1,1nr | awk -v n="$limit" 'NR<=n' | while ...
{noformat}
or add {{|| true}} to that pipeline. Any other {{sort | head}}-style pipeline
that runs under the trap could fail the same way.
_Claude Code on behalf of davsclaus_
> GitHub action failure for very long jobs: 'Broken pipe'
> -------------------------------------------------------
>
> Key: CAMEL-24777
> URL: https://issues.apache.org/jira/browse/CAMEL-24777
> Project: Camel
> Issue Type: Task
> Components: build system
> Affects Versions: 4.23.0
> Reporter: Aurélien Pupier
> Assignee: Guillaume Nodet
> Priority: Major
> Fix For: 4.23.0
>
>
> {noformat}
> sort: write failed: 'standard output': Broken pipe
> sort: write error
> {noformat}
> despite the build went fine based on stored logs
> see for instance
> https://github.com/apache/camel/actions/runs/34954223946/job/104752329188?pr=26460#step:15:726
--
This message was sent by Atlassian Jira
(v8.20.10#820010)