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

Add support for automatic cancellation of running/pending builds #2267

Closed
wants to merge 1 commit into from

Conversation

oldmantaiter
Copy link

By using two new variables (flagged as EXPERIMENTAL), new builds
for a branch will check to see whether it should cancel any preceding
builds.

Cancelling pending builds uses the same logic that killing zombie processes
does, and cancelling running builds uses the same logic that cancelling from
the UI does.

Deals, in part, with the ideas discussed in #1980

@CLAassistant
Copy link

CLAassistant commented Nov 19, 2017

CLA assistant check
All committers have signed the CLA.

oldmantaiter added a commit to oldmantaiter/docs that referenced this pull request Nov 19, 2017
oldmantaiter added a commit to oldmantaiter/docs that referenced this pull request Nov 19, 2017
oldmantaiter added a commit to oldmantaiter/docs that referenced this pull request Nov 19, 2017
oldmantaiter added a commit to oldmantaiter/docs that referenced this pull request Nov 19, 2017
@oldmantaiter
Copy link
Author

@bradrydzewski - Have you had time to take a look at this? I've been running it in my stack since I opened the PR and it doesn't seem to have any issues that I've noticed.

@bradrydzewski
Copy link

bradrydzewski commented Dec 8, 2017

Sorry for the delayed reply. Auto-cancel is something that would be implemented at the repository-level as opposed to a global setting. It would also only cancel pending builds (not yet possible in Drone) as opposed to running builds. The planned design is based on how other systems handle this feature (see below screenshot for prior art).

The ability to cancel pending builds should land in 0.9 with our new queue system, which could then be used to implement auto-cancel for pending builds.

screenshot

@oldmantaiter
Copy link
Author

@bradrydzewski - Thanks for the update. I've seen a couple threads asking for auto-cancel of running builds, so I am wondering if once those 0.9 features land I could take a crack at implementing auto-cancel of running builds? I think if people understand that once enabled it is not responsible for gracefully stopping the running build, then maybe it can be labelled as an "at your own risk" feature that will only be allowed in the community edition and hidden behind a server config enabling the server to look for the repo config variable that allows cancelling running builds for the same branch. What do you think?

@casiodk
Copy link

casiodk commented Feb 15, 2018

how far is this feature from release?

@damm
Copy link

damm commented May 24, 2018

Crickets this feature would be quite helpful as one of our tests spawns a bunch of docker containers (using dind) and if I push too fast I can take down our drone host easily

32gigs of ram it's not huge but would be helpful if it would auto cancel the previous build in favor of a new build if i push into a branch.

@thunderball1
Copy link

Is this going to be merged?

@bradrydzewski
Copy link

@thunderball1 see comment here #2267 (comment) tldr we want per-repository implementation, not global

@oldmantaiter
Copy link
Author

@bradrydzewski Is there a branch for the new queuing system you mentioned in #2267 (comment) ?

By using two new variables (flagged as EXPERIMENTAL), new builds
for a branch will check to see whether it should cancel any preceding
builds.

Cancelling pending builds uses the same logic that killing zombie processes
does, and cancelling running builds uses the same logic that cancelling from
the UI does.
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

6 participants