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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package revision race #395

Open
enykeev opened this issue Dec 19, 2016 · 4 comments
Open

Package revision race #395

enykeev opened this issue Dec 19, 2016 · 4 comments
Labels

Comments

@enykeev
Copy link
Member

enykeev commented Dec 19, 2016

Between fetching a revision number as a part of checkout and uploading a new package with this revision during deploy, every parallel package build will end up with the same revision number and will fail on deploy stage due to package already being present.

@arm4b
Copy link
Member

arm4b commented Dec 20, 2016

That's what I thought about when implemented existing revision number logic. I wanted to rely on external service like Redis with locking and releasing to avoid any possible race conditions around revision number like this.

But with time, I must admit that it was over-engineering, rather then real case.
Race never happened, because one thing is PR where release number doesn't matter and another thing is Merge.
What's important for us is post-merge build, which happens pretty rarely (a couple of times/month in st2-packages and a couple of times/day for st2 in average).

@arm4b
Copy link
Member

arm4b commented Jul 20, 2017

Happened for the first time now with @Kami during the year or something 👍
https://circleci.com/gh/StackStorm/st2/4522
If there is less than 10mins between merging 2 PRs into master, - they'll race on package revision.

@arm4b arm4b added the bug label Jul 20, 2017
@arm4b
Copy link
Member

arm4b commented Jul 20, 2017

I still think by implementing some locking and relying on external service would be overengineering.

Solution for now: don't merge 2 PRs in one go.

If that issue will happen again and again, - then yes worth adding some external Consul or Redis or whatever for revision locking.

@arm4b
Copy link
Member

arm4b commented Aug 23, 2017

Update: the race happened one more time during the 2.4 release when we trigger the build for both st2-packages + st2 repos at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants