Skip to content

Do not let the change listing kill the publish step - #67

Merged
slachiewicz merged 1 commit into
masterfrom
fix/site-workflow-sigpipe
Aug 8, 2026
Merged

Do not let the change listing kill the publish step#67
slachiewicz merged 1 commit into
masterfrom
fix/site-workflow-sigpipe

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

The first run that got past authentication failed at the very last hurdle, on plexus-utils:

M  apidocs/org/codehaus/plexus/util/StringUtils.html
M  apidocs/org/codehaus/plexus/util/SweeperPool.html
...
##[error]Process completed with exit code 141

141 is SIGPIPE, and it is my bug, in this line:

git status --short | head -50

head exits after 50 lines. git status is then killed writing to a closed pipe. Under set -o pipefail that becomes the pipeline's exit status, and set -e makes it fatal.

Reproduced exactly:

$ bash -c 'set -euo pipefail; seq 1 500000 | head -50 >/dev/null'   # exit 141
$ bash -c 'set -euo pipefail; seq 1 500000 | sed -n "1,50p" >/dev/null'  # exit 0

It only bites when the output exceeds the pipe buffer, so this would have published a small site perfectly well and failed on a large one — plexus-utils regenerates thousands of apidocs files. A nastier failure mode than a consistent one.

The fix uses sed, which reads to end of input instead of exiting early, and says how many files were omitted from the listing.

The good news

Nothing was published, and everything before this worked. The step died before the commit, and the log shows the clone, the token authentication and the rsync all succeeded — the run had a fully populated gh-pages checkout with the new site staged. So the approach in #66 is sound; this is the last thing between it and a working publish.

Worth saying plainly: two failed runs, both mine, both found by actually running it rather than by reading it. The dry-run input has paid for itself twice now.

The first successful run got as far as listing what it was about to
publish and then died with exit 141:

  M  apidocs/org/codehaus/plexus/util/StringUtils.html
  ...
  ##[error]Process completed with exit code 141

141 is SIGPIPE. The listing was "git status --short | head -50"; head
exits after 50 lines, git status is killed writing to the closed pipe,
and under `set -o pipefail` that becomes the exit status of the whole
pipeline, which `set -e` then treats as fatal.

It only shows up when the output exceeds the pipe buffer, so a small
site would have published fine and a large one would not - plexus-utils
regenerates thousands of apidocs files.

Uses sed, which reads to end of input rather than exiting early, and
reports how many files were truncated from the listing.

Nothing was published in the failed run: the step died before the
commit. The clone, the token authentication and the rsync all worked,
so the fix in #66 is sound.
@slachiewicz slachiewicz added the build Pull requests that change the build process label Aug 8, 2026
@slachiewicz
slachiewicz merged commit 868062e into master Aug 8, 2026
@slachiewicz
slachiewicz deleted the fix/site-workflow-sigpipe branch August 8, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Pull requests that change the build process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant