Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDP-2032 when api returns a 401 stop retrying and bail out #2569

Merged
merged 4 commits into from Jan 18, 2024

Conversation

SorchaAbel
Copy link
Contributor

@SorchaAbel SorchaAbel commented Dec 22, 2023

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

Screenshot 2023-12-22 at 3 58 30 pm

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) 馃槵
Screenshot 2024-01-05 at 11 13 25 am

@SorchaAbel SorchaAbel force-pushed the PDP-2032-bail-out-when-401 branch 5 times, most recently from 5c949ed to d0a7083 Compare January 5, 2024 03:25
@SorchaAbel SorchaAbel marked this pull request as ready for review January 5, 2024 03:38
README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@DrJosh9000 DrJosh9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

agent/job_runner.go Outdated Show resolved Hide resolved
Co-authored-by: Josh Deprez <jd@buildkite.com>
@SorchaAbel SorchaAbel merged commit af42531 into main Jan 18, 2024
1 check passed
@SorchaAbel SorchaAbel deleted the PDP-2032-bail-out-when-401 branch January 18, 2024 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants