Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout values of one aggregate block affect another aggregate block (with different task_id pattern) #112

Closed
azuk opened this issue Apr 23, 2021 · 4 comments

Comments

@azuk
Copy link

azuk commented Apr 23, 2021

Logstash information:

  1. Logstash version: both 7.12.0 and 5.5.2
  2. Logstash installation source: expanded from zip archive
  3. How is Logstash being run: Via command line: ./logstash -f ./test.conf -w 1
  4. How was the Logstash Plugin installed: it was built-in

JVM (e.g. java -version):

  1. JVM version (java -version): openjdk version "1.8.0_282"
  2. JVM installation source (e.g. from the Operating System's package manager, from source, etc): Kubuntu 20.04 package
  3. Value of the JAVA_HOME environment variable if set: not set

OS version (uname -a if on a Unix-like system):
Kubuntu 20.04 x86_64

Description of the problem including expected versus actual behavior:
Actual behaviour:
timeout values of one aggregate block affect another aggregate block (with different task_id pattern) even though documentation and existence of issue #42 suggest that one can specify task_id pattern specific timeout values. Logstash startup fails with pipeline error with message "Aggregate plugin: For task_id pattern %{fingerprint}, inactivity_timeout must be lower than timeout"

Although I'm not the same person who started https://discuss.elastic.co/t/two-different-aggregate-blocks-in-one-logstash-filter/225205, that seems to be the same issue and confirmed, so I didn't start another discussion.

Expected behaviour:
Given the attached test.conf file, aggregate plugin does not fail with "Aggregate plugin: For task_id pattern %{fingerprint}, inactivity_timeout must be lower than timeout" error.

Steps to reproduce:

Using logstash version and OS as described above:

  1. Download the attached test.conf (renamed to test.conf.txt to make github accept it)
    test.conf.txt
    test.conf.txt

configuration file.
2. Run mkdir -p /tmp/logstash/data
3. Run logstash from its bin directory as follows: ./logstash -f test.conf -w 1

For some reason, if I use different timeout values (documented in comments of test.conf) in the first aggregate block, the problem disappears. However, with my production system/configuration the behaviour is exactly the opposite (the values that work with test.conf cause error, the values that cause error with test.conf don't cause error). I haven't figured out the cause for that. I had trouble with reproducing the problem in other ways as well.

Provide logs (if relevant):
Full error message:

[2021-04-23T19:13:18,833][ERROR][logstash.javapipeline    ][main] Pipeline error {:pipeline_id=>"main", :exception=>#<LogStash::ConfigurationError: Aggregate plugin: For task_id pattern %{fingerprint}, inactivity_timeout must be lower than timeout>, :backtrace=>["/home/secret/logstash-7.12.0/vendor/bundle/jruby/2.5.0/gems/logstash-filter-aggregate-2.9.1/lib/logstash/filters/aggregate.rb:117:in `block in register'", "org/jruby/ext/thread/Mutex.java:164:in `synchronize'", "/home/secret/logstash-7.12.0/vendor/bundle/jruby/2.5.0/gems/logstash-filter-aggregate-2.9.1/lib/logstash/filters/aggregate.rb:97:in `register'", "org/logstash/config/ir/compiler/AbstractFilterDelegatorExt.java:75:in `register'", "/home/secret/logstash-7.12.0/logstash-core/lib/logstash/java_pipeline.rb:228:in `block in register_plugins'", "org/jruby/RubyArray.java:1809:in `each'", "/home/secret/logstash-7.12.0/logstash-core/lib/logstash/java_pipeline.rb:227:in `register_plugins'", "/home/secret/logstash-7.12.0/logstash-core/lib/logstash/java_pipeline.rb:586:in `maybe_setup_out_plugins'", "/home/secret/logstash-7.12.0/logstash-core/lib/logstash/java_pipeline.rb:240:in `start_workers'", "/home/secret/logstash-7.12.0/logstash-core/lib/logstash/java_pipeline.rb:185:in `run'", "/home/secret/logstash-7.12.0/logstash-core/lib/logstash/java_pipeline.rb:137:in `block in start'"], "pipeline.sources"=>["/home/hannuko/projects/trop/scripts/test.conf"], :thread=>"#<Thread:0x3a504584 run>"}
[2021-04-23T19:13:18,838][INFO ][logstash.javapipeline    ][main] Pipeline terminated {"pipeline.id"=>"main"}
[2021-04-23T19:13:18,867][ERROR][logstash.agent           ] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create<main>, action_result: false", :backtrace=>nil}
[2021-04-23T19:13:19,011][INFO ][logstash.runner          ] Logstash shut down.
[2021-04-23T19:13:19,025][FATAL][org.logstash.Logstash    ] Logstash stopped processing because of an error: (SystemExit) exit
@azuk azuk added the bug Something isn't working label Apr 23, 2021
@fbaligand
Copy link
Collaborator

Hi,
I confirm the issue, and see what is the fix.

fbaligand added a commit to fbaligand/logstash-filter-aggregate that referenced this issue Apr 25, 2021
@fbaligand fbaligand added v2.9.2 bug and removed bug Something isn't working labels Apr 25, 2021
@fbaligand
Copy link
Collaborator

fbaligand commented Apr 25, 2021

Hi,

I just fixed the issue and published v2.9.2 release!

I invite you to test it (update your plugin version in your Logstash installation).
And tell me if it fixes your problem :)

@azuk
Copy link
Author

azuk commented Apr 26, 2021

I can happily confirm that v2.9.2 fixes the problem for me. Thanks!

@fbaligand
Copy link
Collaborator

Great!
Thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants