You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
add bash function for retrying ghcr operations - #411
Lately we have been getting too many failed builds due to ghcr throttling resulting in failed docker pull or build operations.
This PR introduces a bash function that acts as a wrapper for any docker pull and build operation. This wrapper writes the stderr to a file (while still outputting stdout and stderr to terminal for jenkins logging). If the command exits non-zero, it looks for the string retry-after: in stderr and if found, it retries the command up to 5 times with exponential delay.
Some of the error messages we have received in recent builds are as follows:
docker: Error response from daemon: error from registry: retry-after: 918.388µs, allowed: 44000/minute
Error response from daemon: error from registry: retry-after: 328.54µs, allowed: 44000/minute
error from registry: retry-after: 410.616µs, allowed: 44000/minute
So something I have noticed is that on the gitlab failures no amount of backoff works it just delays the build for an hour. Should we fail fast on gitlab? Fail fast meaning just skip it like it does now without the hour long delay.
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
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.
Lately we have been getting too many failed builds due to ghcr throttling resulting in failed docker pull or build operations.
This PR introduces a bash function that acts as a wrapper for any docker pull and build operation. This wrapper writes the stderr to a file (while still outputting stdout and stderr to terminal for jenkins logging). If the command exits non-zero, it looks for the string
retry-after:in stderr and if found, it retries the command up to 5 times with exponential delay.Some of the error messages we have received in recent builds are as follows:
docker: Error response from daemon: error from registry: retry-after: 918.388µs, allowed: 44000/minuteError response from daemon: error from registry: retry-after: 328.54µs, allowed: 44000/minuteerror from registry: retry-after: 410.616µs, allowed: 44000/minutetoomanyrequests: retry-after: 391.125µs, allowed: 44000/minuteThey all seem to contain
retry-after:EDIT:
I did a live test with successful operations (nothing failed that time unfortunately):
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-synclounge/job/test/5/stages/
I also did local tests where I simulated script failures with stderr output:
Failing script with stderr message not containing
retry-after::as expected, the script fails, but is not retried, the function exits with the script's exit code
Failing script with stderr message containing
retry-after::It is retried 5 times and the function exits with the same code as the script