Cleanup stuck CI builds
Fixes #3143 (closed)
Merge request reports
Activity
- app/workers/stuck_ci_builds_worker.rb 0 → 100644
4 5 recurrence { daily } 6 7 def perform 8 Rails.logger.info 'Cleaning stuck builds' 9 10 Ci::Build.pending.where('created_at < ?', 1.day.ago).find_each(batch_size: 50).each do |build| 11 Rails.logger.debug "Dropping pending build #{build.id}" 12 build.drop 13 end 14 15 Ci::Build.running.where('started_at < ?', 1.day.ago).find_each(batch_size: 50).each do |build| 16 Rails.logger.debug "Dropping running build #{build.id}" 17 build.drop 18 end 19 end However, we should execute the following code once for GitLab.com.
@ayufan what do you mean?
@dzaporozhets I think @ayufan is eager to run this cleanup on gitlab.com now, instead of in a month.
@jacobvosmaer oh makes sense
@dzaporozhets Updated
mentioned in issue #3143 (closed)
@ayufan looks good. Merge it
@dzaporozhets We had talk with @jacobvosmaer and @razer6 about it and it will not be good solution to set the hard limit for running builds. I'll change it to relay on updated_at for pending and running builds as indication if the build is dead or not.
@ayufan ok
Added 177 commits:
- 37e67f1f...5782217b - 176 commits from branch
master
- 4357736c - Cleanup stuck CI builds daily
- 37e67f1f...5782217b - 176 commits from branch
Reassigned to @dzaporozhets
@ayufan looks good. Make tests green and merge
Reassigned to @ayufan
mentioned in commit 77ef4855
mentioned in issue #27523 (closed)