Repository navigation
ci: limit the slowest modules with awk, not head, so sort does not fail the build - #27169
Merged
Merged
Conversation
…il the build render_top_slowest_modules piped sort into head -n. incremental-build.sh ignores SIGPIPE (trap '' PIPE, CAMEL-24777), so once head stops reading, sort gets EPIPE, prints "sort: write error" and exits 2; under pipefail that fails the job after a successful Maven build. awk reads all of its input, so the pipeline completes. A test runs a large reactor through the function with SIGPIPE ignored. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet-bot
approved these changes
Oct 1, 2026
gnodet-bot
left a comment
Contributor
There was a problem hiding this comment.
Solid fix. Replacing head -n with awk 'NR <= n' correctly eliminates the SIGPIPE/EPIPE race: awk consumes all of sort's output so the pipe never breaks, regardless of the trap '' PIPE in the parent script. Edge cases (limit=0, limit > input, empty input) are fine. The 50k-module test covers the exact failure mode.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude Code on behalf of davsclaus
Related: CAMEL-24777 (assigned to gnodet; this PR does not take the ticket over, see the root-cause comment).
PR builds have been failing after Maven finished successfully:
e.g. 27150, 27147.
render_top_slowest_modulesinreactor_timing.sh(added in #26147) pipessortintohead -n "$limit".incremental-build.shignores SIGPIPE (trap '' PIPE, #26528), so onceheadhas its lines and closes the pipe,sortgets EPIPE, printswrite errorand exits 2; withpipefailandset -ethat fails the step. Without the trapsortis killed by SIGPIPE instead (exit 141), which fails the same way, so reverting #26528 would not help.The limit is now taken with
awk -v n="$limit" 'NR <= n', which reads all of its input.Tests
reactor_timing_test.shgets a case that runs a 50000-module reactor through the function with SIGPIPE ignored. WithLC_ALL=C: 26 passed with the fix; withheadrestored the new case fails (2 failures). (WithoutLC_ALL=Cthree existing duration tests fail on a comma-decimal locale, on main as well.)🤖 Generated with Claude Code