logstash-filter-metrics icon indicating copy to clipboard operation
logstash-filter-metrics copied to clipboard

Adding metrics to pipeline causing delay until timeout when shutting logstash down

Open Ultimation opened this issue 7 years ago • 2 comments

When restarting logstash, I'm seeing a loop until the timeout hard kills Logstash. This happens when I add metrics.

  • Version: 4.0.3
  • Operating System: Centos 7
  • Config File:
filter{
  metrics {
    meter => "events"
    add_tag => "metric"
  }
}
  • Log output:
[2018-01-17T14:29:25,890][WARN ][logstash.shutdownwatcher ] {"inflight_count"=>0, "stalling_thread_info"=>{"other"=>[{"thread_id"=>21, "name"=>"[main]>worker2", "current_call"=>"[...]/vendor/bundle/jruby/1.9/gems/logstash-filter-metrics-4.0.3/lib/logstash/filters/metrics.rb:196:in `gethostname'"}], ["LogStash::Filters::Metrics", {"meter"=>"events", "add_tag"=>"metric", "id"=>"63edd9b41d5c57acdf287fb8d1ea62420186081c-7"}]=>[{"thread_id"=>22, "name"=>"[main]>worker3", "current_call"=>"[...]/vendor/bundle/jruby/1.9/gems/logstash-filter-metrics-4.0.3/lib/logstash/filters/metrics.rb:196:in `gethostname'"}]}}
  • Steps to Reproduce: Add a metrics counter to the pipeline.

  • Additional notes: This command runs fine in normal irb.

irb(main):001:0> require 'socket'
=> true
irb(main):002:0> Socket.gethostname
=> "myhostname"
irb(main):003:0> Socket.gethostname.force_encoding(Encoding::UTF_8)
=> "myhostname"

Ultimation avatar Jan 17 '18 14:01 Ultimation

can you check if adding 127.0.0.1 myhostname to /etc/hosts makes that faster?

jsvd avatar Jan 17 '18 14:01 jsvd

Yeah that has sped it up!

In my /etc/hosts I had: 127.0.0.1 myhostname But hostname returned myhostname.domain Adding 127.0.0.1 myhostname.domain into /etc/hosts fixed it.

Ultimation avatar Jan 17 '18 15:01 Ultimation