logstash-plugins / logstash-output-file

Apache License 2.0
23 stars 53 forks source link

A big value for `flush_interval` option prevents logstash from shutting down #90

Open rocco8620 opened 3 years ago

rocco8620 commented 3 years ago

Hello,

I noticed that setting a moderately high value for the flush_interval option (600 seconds) prevents logstash from shutting down.

If i keep the same configuration and set the flush_interval to 30 seconds logstash shutdowns normally.

I am testing this code in an environment with multiple pipelines and didn't test if the problem occurs with a single pipeline.

For all general issues, please provide the following details for fast resolution:

  1. Start a logstash instance with a pipeline using the following file output configuration
file {
    path => "/data/%{[@metadata][beat]}.json" 
    flush_interval => 600
    codec => line { format => "%{[event][original]}"}
}
  1. Start logstash (for example with systemctl start logstash.service) and wait for it to start.

  2. Stop logstash (for example with systemctl stop logstash.service) and check the logs, they will probably contain lots of rows similar to the following and logstash will hang:

[2020-10-30T10:11:04,951][WARN ][org.logstash.execution.ShutdownWatcherExt] {"inflight_count"=>0, "stalling_threads_info"=>{}}
[2020-10-30T10:11:09,958][WARN ][org.logstash.execution.ShutdownWatcherExt] {"inflight_count"=>0, "stalling_threads_info"=>{}}

Can someone confirm this behaviour is not specific to my environment?

Thank you