Http_poller input plugin: connect_timeout ignored

Hi,

It seems like the http_poller input plugin ignores the connect_timeout setting.

Using:
logstash 2.3.2
logstash-input-http_poller 2.0.6

Here is my http_poller conf:

input {
  http_poller {
    urls => {
      metric_healthcheck => "https://www.example.com/healthcheck.php"
    }
    interval => 5
    connect_timeout => 5
    request_timeout => 5
    keepalive => false
    codec => "json"
 }

  http_poller {
    urls => {
       metric_counters => "https://www.example.com/counters.php"
    }
    interval => 60
    connect_timeout => 30
    request_timeout => 30
    keepalive => false
    codec => "json"
  }
}

Simulating a long response on any of the tested URLs always ends up with a timeout of 10 seconds (which is the default for connect_timeout setting).

Also, as can be seen in Logstash logs, the timeout is set to 'nil':

/var/log/logstash/logstash.log:{[...] :message=>"Registering http_poller Input" [...] :interval=>60, :timeout=>nil, :level=>:info}
/var/log/logstash/logstash.log:{[...] :message=>"Registering http_poller Input" [...] :interval=>5, :timeout=>nil, :level=>:info}

Is it a bug?

Thanks
MG

After checking the source code of the underlying component logstash-mixin-http_client, I've found the following undocumented configuration setting: socket_timeout

So I set it in the http_poller configuration file (socket_timeout => 30), and forced the target test page to simulate a long response (using PHP function sleep(60);), and it worked as expected!

So maybe the http_poller documentation page is not up to date...

1 Like