PDP-2032 when api returns a 401 stop retrying and bail out #2569
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.
https://linear.app/buildkite/issue/PDP-2032/on-the-agent-side-we-need-to-not-retry-on-a-401
This PR is related to job tokens
When the agent receives a 401 from the api due to invalid tokens we don't want to keep retrying. Below is a screen shot of what happens when the token expires
This PR is my very poor attempt to stop the agent retrying when it gets a 401. The screenshot below gives a bit more detail
Testing on Localhost
Now when a token expires (buildkite returns a 401) the agent will eventually stop trying however it does seem to repeatedly loop thru the whole process (assigned..started..process is running..job token error..finished..and then back to assigned again). In my test I have a job that has timed out but I'm worried if a job doesn't have
timeout_in_minutes:
would it just run for 30 days or 24 hours (lost grace period exceeded) 馃槵