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
ac356b83
Commit
ac356b83
authored
Sep 01, 2021
by
nmilojevic1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change order of sidekiq LoadBalancing middleware
parent
b202c100
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
lib/gitlab/sidekiq_middleware.rb
lib/gitlab/sidekiq_middleware.rb
+7
-3
spec/lib/gitlab/sidekiq_middleware_spec.rb
spec/lib/gitlab/sidekiq_middleware_spec.rb
+4
-4
No files found.
lib/gitlab/sidekiq_middleware.rb
View file @
ac356b83
...
@@ -26,12 +26,14 @@ module Gitlab
...
@@ -26,12 +26,14 @@ module Gitlab
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
BatchLoader
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
BatchLoader
chain
.
add
::
Labkit
::
Middleware
::
Sidekiq
::
Server
chain
.
add
::
Labkit
::
Middleware
::
Sidekiq
::
Server
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
InstrumentationLogger
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
InstrumentationLogger
chain
.
add
::
Gitlab
::
Database
::
LoadBalancing
::
SidekiqServerMiddleware
if
load_balancing_enabled?
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
AdminMode
::
Server
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
AdminMode
::
Server
chain
.
add
::
Gitlab
::
SidekiqVersioning
::
Middleware
chain
.
add
::
Gitlab
::
SidekiqVersioning
::
Middleware
chain
.
add
::
Gitlab
::
SidekiqStatus
::
ServerMiddleware
chain
.
add
::
Gitlab
::
SidekiqStatus
::
ServerMiddleware
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
WorkerContext
::
Server
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
WorkerContext
::
Server
# DuplicateJobs::Server should be placed at the bottom, but before the SidekiqServerMiddleware,
# so we can compare the latest WAL location against replica
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
DuplicateJobs
::
Server
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
DuplicateJobs
::
Server
chain
.
add
::
Gitlab
::
Database
::
LoadBalancing
::
SidekiqServerMiddleware
if
load_balancing_enabled?
end
end
end
end
...
@@ -42,13 +44,15 @@ module Gitlab
...
@@ -42,13 +44,15 @@ module Gitlab
lambda
do
|
chain
|
lambda
do
|
chain
|
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
WorkerContext
::
Client
# needs to be before the Labkit middleware
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
WorkerContext
::
Client
# needs to be before the Labkit middleware
chain
.
add
::
Labkit
::
Middleware
::
Sidekiq
::
Client
chain
.
add
::
Labkit
::
Middleware
::
Sidekiq
::
Client
# Sidekiq Client Middleware should be placed before DuplicateJobs::Client middleware,
# so we can store WAL location before we deduplicate the job.
chain
.
add
::
Gitlab
::
Database
::
LoadBalancing
::
SidekiqClientMiddleware
if
load_balancing_enabled?
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
DuplicateJobs
::
Client
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
DuplicateJobs
::
Client
chain
.
add
::
Gitlab
::
SidekiqStatus
::
ClientMiddleware
chain
.
add
::
Gitlab
::
SidekiqStatus
::
ClientMiddleware
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
AdminMode
::
Client
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
AdminMode
::
Client
# Size limiter should be placed at the bottom, but before the metrics midleware
# Size limiter should be placed at the bottom, but before the metrics mid
d
leware
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
SizeLimiter
::
Client
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
SizeLimiter
::
Client
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
ClientMetrics
chain
.
add
::
Gitlab
::
SidekiqMiddleware
::
ClientMetrics
chain
.
add
::
Gitlab
::
Database
::
LoadBalancing
::
SidekiqClientMiddleware
if
load_balancing_enabled?
end
end
end
end
...
...
spec/lib/gitlab/sidekiq_middleware_spec.rb
View file @
ac356b83
...
@@ -66,12 +66,12 @@ RSpec.describe Gitlab::SidekiqMiddleware do
...
@@ -66,12 +66,12 @@ RSpec.describe Gitlab::SidekiqMiddleware do
::
Gitlab
::
SidekiqMiddleware
::
BatchLoader
,
::
Gitlab
::
SidekiqMiddleware
::
BatchLoader
,
::
Labkit
::
Middleware
::
Sidekiq
::
Server
,
::
Labkit
::
Middleware
::
Sidekiq
::
Server
,
::
Gitlab
::
SidekiqMiddleware
::
InstrumentationLogger
,
::
Gitlab
::
SidekiqMiddleware
::
InstrumentationLogger
,
::
Gitlab
::
Database
::
LoadBalancing
::
SidekiqServerMiddleware
,
::
Gitlab
::
SidekiqMiddleware
::
AdminMode
::
Server
,
::
Gitlab
::
SidekiqMiddleware
::
AdminMode
::
Server
,
::
Gitlab
::
SidekiqVersioning
::
Middleware
,
::
Gitlab
::
SidekiqVersioning
::
Middleware
,
::
Gitlab
::
SidekiqStatus
::
ServerMiddleware
,
::
Gitlab
::
SidekiqStatus
::
ServerMiddleware
,
::
Gitlab
::
SidekiqMiddleware
::
WorkerContext
::
Server
,
::
Gitlab
::
SidekiqMiddleware
::
WorkerContext
::
Server
,
::
Gitlab
::
SidekiqMiddleware
::
DuplicateJobs
::
Server
::
Gitlab
::
SidekiqMiddleware
::
DuplicateJobs
::
Server
,
::
Gitlab
::
Database
::
LoadBalancing
::
SidekiqServerMiddleware
]
]
end
end
...
@@ -177,12 +177,12 @@ RSpec.describe Gitlab::SidekiqMiddleware do
...
@@ -177,12 +177,12 @@ RSpec.describe Gitlab::SidekiqMiddleware do
[
[
::
Gitlab
::
SidekiqMiddleware
::
WorkerContext
::
Client
,
::
Gitlab
::
SidekiqMiddleware
::
WorkerContext
::
Client
,
::
Labkit
::
Middleware
::
Sidekiq
::
Client
,
::
Labkit
::
Middleware
::
Sidekiq
::
Client
,
::
Gitlab
::
Database
::
LoadBalancing
::
SidekiqClientMiddleware
,
::
Gitlab
::
SidekiqMiddleware
::
DuplicateJobs
::
Client
,
::
Gitlab
::
SidekiqMiddleware
::
DuplicateJobs
::
Client
,
::
Gitlab
::
SidekiqStatus
::
ClientMiddleware
,
::
Gitlab
::
SidekiqStatus
::
ClientMiddleware
,
::
Gitlab
::
SidekiqMiddleware
::
AdminMode
::
Client
,
::
Gitlab
::
SidekiqMiddleware
::
AdminMode
::
Client
,
::
Gitlab
::
SidekiqMiddleware
::
SizeLimiter
::
Client
,
::
Gitlab
::
SidekiqMiddleware
::
SizeLimiter
::
Client
,
::
Gitlab
::
SidekiqMiddleware
::
ClientMetrics
,
::
Gitlab
::
SidekiqMiddleware
::
ClientMetrics
::
Gitlab
::
Database
::
LoadBalancing
::
SidekiqClientMiddleware
]
]
end
end
...
...
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