How to properly shutdown an input plugin

I'm trying to modify an input plugin to stop under some conditions, but when I execute the stop function, it generates an exception.
How can I shutdown properly ?

What's the exception?

Hi Magnus,

Here is the exception when I call the stop function:
[2017-01-30T17:27:09,796][WARN ][logstash.agent ] stopping
pipeline {:id=>"main"}
[2017-01-30T17:27:09,808][FATAL][logstash.runner ] An unexpected
error occurred! {:error=>#<ThreadError: killed thread>,
:backtrace=>["org/jruby/RubyThread.java:836:in wakeup'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.22/lib/stud/interval.rb:44:instop!'", "/opt/logstash/logstash-input-s3/lib/logstash/inputs/s3.rb:167:in
stop'", "/opt/logstash/logstash-core/lib/logstash/inputs/base.rb:89:indo_stop'", "org/jruby/RubyArray.java:1613:in each'", "/opt/logstash/logstash-core/lib/logstash/pipeline.rb:408:inshutdown'",
"/opt/logstash/logstash-core/lib/logstash/agent.rb:317:in stop_pipeline'", "/opt/logstash/logstash-core/lib/logstash/agent.rb:330:inshutdown_pipelines'", "org/jruby/RubyHash.java:1342:in each'", "/opt/logstash/logstash-core/lib/logstash/agent.rb:330:inshutdown_pipelines'",
"/opt/logstash/logstash-core/lib/logstash/agent.rb:138:in shutdown'", "/opt/logstash/logstash-core/lib/logstash/runner.rb:274:inexecute'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in
run'", "/opt/logstash/logstash-core/lib/logstash/runner.rb:178:inrun'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in
run'", "/opt/logstash/lib/bootstrap/environment.rb:71:in(root)'"]}

Best regards

And if you post the logs as preformatted text so the exception message isn't mangled out of existence?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.