-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retry fork/exec errors when running hook #2325
Merged
Merged
Conversation
This file contains 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
triarius
force-pushed
the
pdp-1510-retry-and-log-hook-forkexec-errors
branch
from
August 28, 2023 03:26
99df9c1
to
18ffa43
Compare
moskyb
reviewed
Aug 28, 2023
Co-authored-by: Ben Moskovitz <ben@mosk.nz>
moskyb
approved these changes
Aug 28, 2023
DrJosh9000
added a commit
that referenced
this pull request
Apr 22, 2024
Since #2325, we learned that the "text file busy" error reported by the customer was probably golang/go#22315. This change makes the retry and log pathway more specific to that error, and retries more times more frequently.
2 tasks
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.
A customer reported that their jobs were unable to run a hook because the hook wrapper script was locked.
The hooks should have collision avoidant names, and they should have closed by the agent worker goroutine that created them prior to execution, which is in the same goroutine. So it's a bit of a mystery how the script wrapper could remain open.
We could just add more retry to work around this, but it would like to find the cause. So, I've done two things in this PR:
That latter will only work if:
So we can't be certain what the other process is, but at least we should be able to prove or disprove that it is the agent itself.
Detecting other processes only works on Linux because it uses the procfs. For other Unixes, we can use
/dev/fd
to check that the agent process does not have the file open. I'm not sure if this will work if the two goroutines are scheduled on different OS threads, however.