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
a0b8e5eb
Commit
a0b8e5eb
authored
Dec 12, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix an exception in Geo scheduler workers
parent
4ccac676
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
app/workers/geo/base_scheduler_worker.rb
app/workers/geo/base_scheduler_worker.rb
+2
-0
changelogs/unreleased-ee/4309-fix-negative-array-size.yml
changelogs/unreleased-ee/4309-fix-negative-array-size.yml
+5
-0
spec/workers/geo/repository_shard_sync_worker_spec.rb
spec/workers/geo/repository_shard_sync_worker_spec.rb
+9
-0
No files found.
app/workers/geo/base_scheduler_worker.rb
View file @
a0b8e5eb
...
...
@@ -124,6 +124,8 @@ module Geo
def
schedule_jobs
capacity
=
max_capacity
num_to_schedule
=
[
capacity
-
scheduled_job_ids
.
size
,
pending_resources
.
size
].
min
num_to_schedule
=
0
if
num_to_schedule
<
0
to_schedule
=
pending_resources
.
shift
(
num_to_schedule
)
scheduled
=
to_schedule
.
map
do
|
args
|
...
...
changelogs/unreleased-ee/4309-fix-negative-array-size.yml
0 → 100644
View file @
a0b8e5eb
---
title
:
Fix an exception in Geo scheduler workers
merge_request
:
3740
author
:
type
:
fixed
spec/workers/geo/repository_shard_sync_worker_spec.rb
View file @
a0b8e5eb
...
...
@@ -175,6 +175,15 @@ describe Geo::RepositoryShardSyncWorker, :geo, :delete, :clean_gitlab_redis_cach
Sidekiq
::
Testing
.
inline!
{
subject
.
perform
(
shard_name
)
}
end
end
context
'number of scheduled jobs exceeds capacity'
do
it
'schedules 0 jobs'
do
is_expected
.
to
receive
(
:scheduled_job_ids
).
and_return
(
1
..
1000
).
at_least
(
:once
)
is_expected
.
not_to
receive
(
:schedule_job
)
Sidekiq
::
Testing
.
inline!
{
subject
.
perform
(
shard_name
)
}
end
end
end
describe
'when PostgreSQL FDW is available'
,
:geo
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