This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new f225f7f93b8d CAMEL-24777: Ignore SIGPIPE in incremental-build.sh to
prevent spurious CI failures (#26528)
f225f7f93b8d is described below
commit f225f7f93b8d17aab041083a658ad1ef21d67400
Author: Guillaume Nodet <[email protected]>
AuthorDate: Fri Sep 18 15:59:16 2026 +0200
CAMEL-24777: Ignore SIGPIPE in incremental-build.sh to prevent spurious CI
failures (#26528)
* CAMEL-24777: Ignore SIGPIPE in incremental-build.sh to prevent spurious
CI failures
On very long GitHub Actions jobs the runner may truncate stdout, causing
commands in pipelines (e.g. sort, grep) to receive SIGPIPE. GNU sort
catches SIGPIPE and exits with code 2; under 'set -euo pipefail' this
terminates the entire script even when the Maven build has already
completed successfully, reporting a false failure.
Fix: add 'trap '' PIPE' immediately after 'set -euo pipefail' so the
SIGPIPE signal is ignored for the lifetime of the script. With SIGPIPE
ignored the pipeline commands in Bash exit 0 (or carry through the ||true
guards already in place), and the script exits with Maven's real return
code instead.
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
* Address review: tighten SIGPIPE comment accuracy
The original comment conflated the EPIPE path (SIG_IGN → write() returns
EPIPE → program exits non-zero) with the SIGPIPE-kill path (exit 141 =
128+13).
The actual trigger in this script is tail -500 "$log" in the
failure-reporting
block writing to a runner-closed stdout, not sort.
Feedback from gnodet-bot review on #26528.
---------
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
---
.github/actions/incremental-build/incremental-build.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/.github/actions/incremental-build/incremental-build.sh
b/.github/actions/incremental-build/incremental-build.sh
index f8e52905e0af..1b9978519841 100755
--- a/.github/actions/incremental-build/incremental-build.sh
+++ b/.github/actions/incremental-build/incremental-build.sh
@@ -29,6 +29,12 @@
# All sets of affected modules are merged and deduplicated before testing.
set -euo pipefail
+# Ignore SIGPIPE to prevent spurious failures on long GitHub Actions jobs.
+# When the runner closes the script's stdout (log line limit reached), external
+# commands writing to it (e.g. `tail -500 "$log"` in the failure report block)
+# are killed by SIGPIPE (exit 141). Ignoring SIGPIPE lets children inherit
+# SIG_IGN, exit via EPIPE instead, and preserves Maven's real return code.
+trap '' PIPE
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=reactor_timing.sh