Repository navigation
Add retry logic for gem install to handle QEMU arm64 segfaults - #1648
Merged
Merged
Conversation
Native extension builds under QEMU emulation for arm64 hit sporadic segfaults in GCC/make. Added gem_install_with_retry() wrapper with 3 retries and explicit exit 1 on exhaustion. Applied to all gem install calls in setup.sh. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
suyadav1
enabled auto-merge (squash)
April 16, 2026 23:27
zanejohnson-azure
approved these changes
Apr 16, 2026
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.
Problem
The
build_linuxjob in the multi-arch build pipeline fails intermittently due to sporadic GCC segfaults when compiling Ruby native gem extensions under QEMU emulation for arm64. Each failure hits a different gem dependency of fluentd (http_parser.rb, msgpack, yajl-ruby). Becausesetup.shhas no error handling ongem install, the failure is silently ignored, and the build later fails at the DockerfileCOPY --from=builder /usr/bin/fluentdstep with a confusing "not found" error.Build #116473 required 5 manual retries before
build_linuxsucceeded.Fix
Added a
gem_install_with_retry()wrapper function inkubernetes/linux/setup.shwith:exit 1after exhausting retries (fail fast with a clear error)gem installcalls, not just fluentdKey Result — Retry logic validated in build #116513
The build succeeded on the first pipeline attempt. Logs show the retry logic was exercised:
gem install fluentdfailed on attempt 1/3 (QEMU segfault), then succeeded on attempt 2/3Without this fix, build #116513 would have failed and required another manual re-run.