Skip to content

Commit 6bc70f6

Browse files
authored
Merge pull request #130 from kaisecheng/doc_clarify_retry_loop
[Doc] clarify retry loop
2 parents ca351c0 + 220558b commit 6bc70f6

File tree

3 files changed

+54
-11
lines changed

3 files changed

+54
-11
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 5.4.1
2+
- Docs: Add retry policy description [#130](https://github.com/logstash-plugins/logstash-output-http/pull/130)
3+
14
## 5.4.0
25
- Introduce retryable unknown exceptions for "connection reset by peer" and "timeout" [#127](https://github.com/logstash-plugins/logstash-output-http/pull/127)
36

docs/index.asciidoc

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,40 @@ guaranteed!
3131

3232
Beware, this gem does not yet support codecs. Please use the 'format' option for now.
3333

34+
[id="plugins-{type}s-{plugin}-retry_policy"]
35+
==== Retry policy
36+
37+
This output has two levels of retry: library and plugin.
38+
39+
[id="plugins-{type}s-{plugin}-library_retry"]
40+
===== Library retry
41+
42+
The library retry applies to IO related failures.
43+
Non retriable errors include SSL related problems, unresolvable hosts,
44+
connection issues, and OS/JVM level interruptions happening during a request.
45+
46+
The options for library retry are:
47+
48+
* <<plugins-{type}s-{plugin}-automatic_retries,`automatic_retries`>>.
49+
Controls the number of times the plugin should retry after failures at the library level.
50+
* <<plugins-{type}s-{plugin}-retry_non_idempotent,`retry_non_idempotent`>>.
51+
When set to `false`, GET, HEAD, PUT, DELETE, OPTIONS, and TRACE requests will be
52+
retried.
53+
54+
[id="plugins-{type}s-{plugin}-plugin_retry"]
55+
===== Plugin retry
56+
57+
The options for plugin level retry are:
58+
59+
* <<plugins-{type}s-{plugin}-retry_failed,`retry_failed`>>.
60+
When set to `true`, the plugin retries indefinitely for HTTP error response codes defined
61+
in the <<plugins-{type}s-{plugin}-retryable_codes,`retryable_codes`>> option
62+
(429, 500, 502, 503, 504) and retryable exceptions (socket timeout/ error, DNS resolution failure and client protocol exception).
63+
* <<plugins-{type}s-{plugin}-retryable_codes,`retryable_codes`>>.
64+
Sets http response codes that trigger a retry.
65+
66+
NOTE: The `retry_failed` option does not control the library level retry.
67+
3468
[id="plugins-{type}s-{plugin}-options"]
3569
==== Http Output Configuration Options
3670

@@ -85,12 +119,10 @@ output plugins.
85119
* Value type is <<number,number>>
86120
* Default value is `1`
87121

88-
How many times should the client retry a failing URL. We highly recommend NOT setting this value
89-
to zero if keepalive is enabled. Some servers incorrectly end keepalives early requiring a retry!
90-
Only IO related failures will be retried, such as connection timeouts and unreachable hosts.
91-
Valid but non 2xx HTTP responses will always be retried, regardless of the value of this setting,
92-
unless `retry_failed` is set.
93-
Note: if `retry_non_idempotent` is NOT set only GET, HEAD, PUT, DELETE, OPTIONS, and TRACE requests will be retried.
122+
How many times should the client retry a failing URL. We recommend setting this option
123+
to a value other than zero if the <<plugins-{type}s-{plugin}-keepalive,`keepalive` option>> is enabled.
124+
Some servers incorrectly end keepalives early, requiring a retry.
125+
See <<plugins-{type}s-{plugin}-retry_policy,Retry Policy>> for more information.
94126

95127
[id="plugins-{type}s-{plugin}-cacert"]
96128
===== `cacert`
@@ -311,24 +343,32 @@ Timeout (in seconds) for the entire request
311343
* Value type is <<boolean,boolean>>
312344
* Default value is `true`
313345

314-
Set this to false if you don't want this output to retry failed requests
346+
Note that this option controls plugin-level retries only.
347+
It has no affect on library-level retries.
348+
349+
Set this option to `false` if you want to disable infinite retries for HTTP error response codes defined in the <<plugins-{type}s-{plugin}-retryable_codes,`retryable_codes`>> or
350+
retryable exceptions (Timeout, SocketException, ClientProtocolException, ResolutionFailure and SocketTimeout).
351+
See <<plugins-{type}s-{plugin}-retry_policy,Retry policy>> for more information.
315352

316353
[id="plugins-{type}s-{plugin}-retry_non_idempotent"]
317354
===== `retry_non_idempotent`
318355

319356
* Value type is <<boolean,boolean>>
320357
* Default value is `false`
321358

322-
If `automatic_retries` is enabled this will cause non-idempotent HTTP verbs (such as POST) to be retried.
323-
This only affects connectivity related errors (see related `automatic_retries` setting).
359+
When this option is set to `false` and `automatic_retries` is enabled, GET, HEAD, PUT, DELETE, OPTIONS, and TRACE requests will be retried.
360+
361+
When set to `true` and `automatic_retries` is enabled, this will cause non-idempotent HTTP verbs (such as POST) to be retried.
362+
See <<plugins-{type}s-{plugin}-retry_policy,Retry Policy>> for more information.
324363

325364
[id="plugins-{type}s-{plugin}-retryable_codes"]
326365
===== `retryable_codes`
327366

328367
* Value type is <<number,number>>
329368
* Default value is `[429, 500, 502, 503, 504]`
330369

331-
If encountered as response codes this plugin will retry these requests
370+
If the plugin encounters these response codes, the plugin will retry indefinitely.
371+
See <<plugins-{type}s-{plugin}-retry_policy,Retry Policy>> for more information.
332372

333373
[id="plugins-{type}s-{plugin}-socket_timeout"]
334374
===== `socket_timeout`

logstash-output-http.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = 'logstash-output-http'
3-
s.version = '5.4.0'
3+
s.version = '5.4.1'
44
s.licenses = ['Apache License (2.0)']
55
s.summary = "Sends events to a generic HTTP or HTTPS endpoint"
66
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"

0 commit comments

Comments
 (0)