Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
caa2f628
Commit
caa2f628
authored
May 27, 2021
by
Allison Browne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove `drop(:running..` due to query plan issues
Address backend reviewer feedback
parent
314b7edb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
16 deletions
+6
-16
app/workers/stuck_ci_jobs_worker.rb
app/workers/stuck_ci_jobs_worker.rb
+5
-5
spec/workers/stuck_ci_jobs_worker_spec.rb
spec/workers/stuck_ci_jobs_worker_spec.rb
+1
-11
No files found.
app/workers/stuck_ci_jobs_worker.rb
View file @
caa2f628
...
@@ -23,28 +23,28 @@ class StuckCiJobsWorker # rubocop:disable Scalability/IdempotentWorker
...
@@ -23,28 +23,28 @@ class StuckCiJobsWorker # rubocop:disable Scalability/IdempotentWorker
drop
(
drop
(
status: :running
,
status: :running
,
search_condition:
'ci_builds.
created_at < ? AND
updated_at < ?'
,
search_condition:
'ci_builds.updated_at < ?'
,
search_condition_params:
[
BUILD_RUNNING_OUTDATED_TIMEOUT
.
ago
,
BUILD_RUNNING_OUTDATED_TIMEOUT
.
ago
],
search_condition_params:
[
BUILD_RUNNING_OUTDATED_TIMEOUT
.
ago
],
failure_reason: :stuck_or_timeout_failure
failure_reason: :stuck_or_timeout_failure
)
)
drop
(
drop
(
status: :pending
,
status: :pending
,
search_condition:
'ci_builds.created_at < ? AND updated_at < ?'
,
search_condition:
'ci_builds.created_at < ? AND
ci_builds.
updated_at < ?'
,
search_condition_params:
[
BUILD_PENDING_OUTDATED_TIMEOUT
.
ago
,
BUILD_PENDING_OUTDATED_TIMEOUT
.
ago
],
search_condition_params:
[
BUILD_PENDING_OUTDATED_TIMEOUT
.
ago
,
BUILD_PENDING_OUTDATED_TIMEOUT
.
ago
],
failure_reason: :stuck_or_timeout_failure
failure_reason: :stuck_or_timeout_failure
)
)
drop
(
drop
(
status: :scheduled
,
status: :scheduled
,
search_condition:
'
scheduled_at IS NOT NULL AND
scheduled_at < ?'
,
search_condition:
'
ci_builds.scheduled_at IS NOT NULL AND ci_builds.
scheduled_at < ?'
,
search_condition_params:
[
BUILD_SCHEDULED_OUTDATED_TIMEOUT
.
ago
],
search_condition_params:
[
BUILD_SCHEDULED_OUTDATED_TIMEOUT
.
ago
],
failure_reason: :stale_schedule
failure_reason: :stale_schedule
)
)
drop_stuck
(
drop_stuck
(
status: :pending
,
status: :pending
,
search_condition:
'ci_builds.created_at < ? AND updated_at < ?'
,
search_condition:
'ci_builds.created_at < ? AND
ci_builds.
updated_at < ?'
,
search_condition_params:
[
BUILD_PENDING_STUCK_TIMEOUT
.
ago
,
BUILD_PENDING_STUCK_TIMEOUT
.
ago
],
search_condition_params:
[
BUILD_PENDING_STUCK_TIMEOUT
.
ago
,
BUILD_PENDING_STUCK_TIMEOUT
.
ago
],
failure_reason: :stuck_or_timeout_failure
failure_reason: :stuck_or_timeout_failure
)
)
...
...
spec/workers/stuck_ci_jobs_worker_spec.rb
View file @
caa2f628
...
@@ -178,19 +178,9 @@ RSpec.describe StuckCiJobsWorker do
...
@@ -178,19 +178,9 @@ RSpec.describe StuckCiJobsWorker do
context
'when job was updated in less than 1 hour ago'
do
context
'when job was updated in less than 1 hour ago'
do
let
(
:updated_at
)
{
30
.
minutes
.
ago
}
let
(
:updated_at
)
{
30
.
minutes
.
ago
}
context
'when created_at is the same as updated_at'
do
let
(
:created_at
)
{
30
.
minutes
.
ago
}
it_behaves_like
'job is unchanged'
end
context
'when created_at is before updated_at'
do
let
(
:created_at
)
{
30
.
minutes
.
ago
}
it_behaves_like
'job is unchanged'
it_behaves_like
'job is unchanged'
end
end
end
end
end
%w(success skipped failed canceled)
.
each
do
|
status
|
%w(success skipped failed canceled)
.
each
do
|
status
|
context
"when job is
#{
status
}
"
do
context
"when job is
#{
status
}
"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment