logstash-plugins/logstash-output-http

Difference between docs and code - automatic retries

Closed this issue · 2 comments

Docs say that config of automatic_retries will set the number of retries, but I don't see any limit to the number of retries performed in the code, and using the plugin also proves it as retries are infinite no matter the config.

Is this the case? It seems no one is using automatic_retries given by the http mixin

add a PR for this on #70
It's just a small check, I don't know what to do with the contributor contract thing

But regardless, since the plugin is set for http mixin 6.0.0, and logstash itself is still on 5.2.1, it can't be used. Can this PR be added to logstash-output-http 4.3.3 or something?

jsvd commented

it seems there an expectation mismatch in the http output between what the http client itself retries and what the http output plugin retries.

By setting the automatic_retries setting, we tell the manticore (http) client to retry by itself. We can see the manticore code here: https://github.com/cheald/manticore/blob/79fbbc51fd5539479b4070eb66cd86de15b2ffb8/lib/manticore/client.rb#L189.

However, after the http client returns from the request call, we still check if this is a retryable situation, by either its return code or if its a retryable exception, and retry.

I believe the correct behaviour would be to not have retry code in the plugin, and use only the manticore's retrying (unless there's some edge case it's not covering).

We need to confirm that the plugin is retrying 3 times before bubbling up an exception that the plugin then catches and retries.