[solved] Prevent parallel builds of the same project / repo

I have increased the number of agents to allow me to have multiple builds at the same time running.

However we’re sometimes running into an issue where two (or more) PRs are merged very closely together (< 1 minute) creating two new commits to the main branch. Both of these are then built in parallel and sometimes the first merge commit finishes building second (race condition), thus pushing an older build to our docker repo and then deploying the older build.

I’ve read other posts on here that ask the same question but without an answer that helps in this situation. e.g. Prevent parallel builds in the same repo

Is there a way to configure to drone to only parallelize builds across projects but not within the same project?

This capability does not exist today, but is planned for the Q3 release.

You could solve this by using a global locking system like zookeeper or even something like redis. You could then package the logic into a nice little plugin as described here: https://github.com/drone/drone/issues/1512#issuecomment-334545931

Hi @bradrydzewski,

Is there an update on this at all?

I’ve had a look through the docs and the release notes but I can’t seem to find anything relating to this.

Many Thanks

Chris

No progress to report.

I have spent some time thinking about the requirements, and decided that I would like to somehow define this behavior in the yaml. I am open to syntax suggestions …

Is this likely to unblock any time in the next three months or so? It is definitely something that would save our environment quite a lot of pain.

This thread is outdated. See http://discuss.harness.io/t/how-to-limit-build-concurrency-per-project/3500