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
1b7c3ff7
Commit
1b7c3ff7
authored
Jul 30, 2021
by
Changzheng Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Configure Elasticsearch Ruby client without retry by default
Changelog: changed EE: true
parent
25a68209
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
ee/lib/gitlab/elastic/client.rb
ee/lib/gitlab/elastic/client.rb
+2
-1
ee/spec/lib/gitlab/elastic/client_spec.rb
ee/spec/lib/gitlab/elastic/client_spec.rb
+19
-0
No files found.
ee/lib/gitlab/elastic/client.rb
View file @
1b7c3ff7
...
...
@@ -8,6 +8,7 @@ module Gitlab
extend
Gitlab
::
Utils
::
StrongMemoize
OPEN_TIMEOUT
=
5
NO_RETRY
=
0
# Takes a hash as returned by `ApplicationSetting#elasticsearch_config`,
# and configures itself based on those parameters
...
...
@@ -21,7 +22,7 @@ module Gitlab
}
},
randomize_hosts:
true
,
retry_on_failure:
true
retry_on_failure:
config
[
:retry_on_failure
]
||
NO_RETRY
}.
compact
if
config
[
:aws
]
...
...
ee/spec/lib/gitlab/elastic/client_spec.rb
View file @
1b7c3ff7
...
...
@@ -32,6 +32,25 @@ RSpec.describe Gitlab::Elastic::Client do
expect
(
options
).
to
include
(
open_timeout:
described_class
::
OPEN_TIMEOUT
,
timeout:
30
)
end
end
context
'with retry_on_failure'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:retry_on_failure
,
:client_retry
)
do
nil
|
0
# not set or nil, no retry
false
|
0
# with false, no retry
true
|
true
# with true, retry with default times
10
|
10
# with a number N, retry N times
end
with_them
do
let
(
:params
)
{
{
url:
'http://dummy-elastic:9200'
,
retry_on_failure:
retry_on_failure
}
}
it
'sets retry in transport'
do
expect
(
client
.
transport
.
options
.
dig
(
:retry_on_failure
)).
to
eq
(
client_retry
)
end
end
end
end
context
'with AWS IAM static credentials'
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