Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add latest changes from gitlab-org/gitlab@master
- Loading branch information
GitLab Bot
committed
Oct 5, 2021
1 parent
8c6c213
commit 33a1d18
Showing
27 changed files
with
332 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
module Ci | ||
module StuckBuilds | ||
class DropScheduledService | ||
include DropHelpers | ||
|
||
BUILD_SCHEDULED_OUTDATED_TIMEOUT = 1.hour | ||
|
||
def execute | ||
Gitlab::AppLogger.info "#{self.class}: Cleaning scheduled, timed-out builds" | ||
|
||
drop(scheduled_timed_out_builds, failure_reason: :stale_schedule) | ||
end | ||
|
||
private | ||
|
||
def scheduled_timed_out_builds | ||
Ci::Build.where(status: :scheduled).where( # rubocop: disable CodeReuse/ActiveRecord | ||
'ci_builds.scheduled_at IS NOT NULL AND ci_builds.scheduled_at < ?', | ||
BUILD_SCHEDULED_OUTDATED_TIMEOUT.ago | ||
) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
module Ci | ||
module StuckBuilds | ||
class DropScheduledWorker | ||
include ApplicationWorker | ||
include ExclusiveLeaseGuard | ||
|
||
idempotent! | ||
|
||
# rubocop:disable Scalability/CronWorkerContext | ||
# This is an instance-wide cleanup query, so there's no meaningful | ||
# scope to consider this in the context of. | ||
include CronjobQueue | ||
# rubocop:enable Scalability/CronWorkerContext | ||
|
||
data_consistency :always | ||
|
||
feature_category :continuous_integration | ||
|
||
def perform | ||
try_obtain_lease do | ||
Ci::StuckBuilds::DropScheduledService.new.execute | ||
end | ||
end | ||
|
||
private | ||
|
||
def lease_timeout | ||
30.minutes | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
config/feature_flags/development/ensure_verified_primary_email_for_2fa.yml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.