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
59e19c49
Commit
59e19c49
authored
Feb 28, 2019
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sidekiq-cluster: put each sidekiq in a new pgroup
We now kill the whole process group for termination signals
parent
6abfc790
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
ee/changelogs/unreleased/ce-40396-sidekiq-cluster-pgroups.yml
...hangelogs/unreleased/ce-40396-sidekiq-cluster-pgroups.yml
+5
-0
ee/lib/gitlab/sidekiq_cluster.rb
ee/lib/gitlab/sidekiq_cluster.rb
+2
-1
ee/spec/lib/gitlab/sidekiq_cluster_spec.rb
ee/spec/lib/gitlab/sidekiq_cluster_spec.rb
+15
-3
No files found.
ee/changelogs/unreleased/ce-40396-sidekiq-cluster-pgroups.yml
0 → 100644
View file @
59e19c49
---
title
:
'
sidekiq-cluster:
put
each
sidekiq
in
a
new
pgroup'
merge_request
:
9775
author
:
type
:
other
ee/lib/gitlab/sidekiq_cluster.rb
View file @
59e19c49
...
...
@@ -56,7 +56,7 @@ module Gitlab
# start([ ['foo'], ['bar', 'baz'] ], :production)
#
# This would start two Sidekiq processes: one processing "foo", and one
# processing "bar" and "baz".
# processing "bar" and "baz".
Each one is placed in its own process group.
#
# queues - An Array containing Arrays. Each sub Array should specify the
# queues to use for a single process.
...
...
@@ -92,6 +92,7 @@ module Gitlab
pid
=
Process
.
spawn
(
{
'ENABLE_SIDEKIQ_CLUSTER'
=>
'1'
},
*
cmd
,
pgroup:
true
,
err:
$stderr
,
out:
$stdout
)
...
...
ee/spec/lib/gitlab/sidekiq_cluster_spec.rb
View file @
59e19c49
...
...
@@ -79,6 +79,7 @@ describe Gitlab::SidekiqCluster do
describe
'.start_sidekiq'
do
let
(
:env
)
{
{
"ENABLE_SIDEKIQ_CLUSTER"
=>
"1"
}
}
let
(
:args
)
{
[
'bundle'
,
'exec'
,
'sidekiq'
,
anything
,
'-eproduction'
,
*
([
anything
]
*
5
)]
}
it
'starts a Sidekiq process'
do
allow
(
Process
).
to
receive
(
:spawn
).
and_return
(
1
)
...
...
@@ -88,13 +89,24 @@ describe Gitlab::SidekiqCluster do
end
it
'handles duplicate queue names'
do
allow
(
Process
).
to
receive
(
:spawn
)
.
with
(
env
,
"bundle"
,
"exec"
,
"sidekiq"
,
"-c 5"
,
"-eproduction"
,
"-gqueues: foo (2), bar, baz"
,
anything
,
"-qfoo,2"
,
"-qbar,1"
,
"-qbaz,1"
,
anything
)
.
and_return
(
1
)
allow
(
Process
)
.
to
receive
(
:spawn
)
.
with
(
env
,
*
args
,
anything
)
.
and_return
(
1
)
expect
(
described_class
).
to
receive
(
:wait_async
).
with
(
1
)
expect
(
described_class
.
start_sidekiq
(
%w(foo foo bar baz)
,
:production
)).
to
eq
(
1
)
end
it
'runs the sidekiq process in a new process group'
do
expect
(
Process
)
.
to
receive
(
:spawn
)
.
with
(
anything
,
*
args
,
a_hash_including
(
pgroup:
true
))
.
and_return
(
1
)
allow
(
described_class
).
to
receive
(
:wait_async
)
expect
(
described_class
.
start_sidekiq
(
%w(foo bar baz)
,
:production
)).
to
eq
(
1
)
end
end
describe
'.wait_async'
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