-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix: implement backoff + retry when GitLab SetCommitStatus returns 409 #4503
Conversation
ec262b2
to
689aaf4
Compare
@lukemassa since you are a Gitlab user. |
Can you add a test for this? |
@X-Guardian I can certainly give it a try again; I came up short figuring out how to make it work in my original implementation. Do Atlantis provide docs on how testing should be done, and the libraries being used? |
The tests for this change need adding to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree about the tests, otherwise this looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, would be good to also have some tests.
I guess, I just echo what my fellow maintainers said :) |
I have a short work week (just 2 days this week); so will probably not get it done this week - but will prioritize it next week , regardless of this is merged in with the future promise of tests or not :) |
yeah, that works. thanks @jippi! |
The promised tests are now up at #4503 :) |
what
GitLab returns a
409 Conflict
status when the commit pipeline status is being changed/locked by another request, which is likely to happen if you use [--parallel-pool-size > 1
] and [parallel-plan|apply
].The likelihood of this happening is increased when the number of parallel apply jobs is increased.
why
Returning the [err] without retrying will permanently leave the GitLab commit status in a "running" state, which would prevent Atlantis from merging the merge request on [apply]. GitLab does not allow merge requests to be merged when the pipeline status is "running."
tests
We've been running these changes in our environment for months and it has eliminated this type of error entirely