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

Stop filterworker and outputworker from crashing #1373

Closed
wants to merge 2 commits into from
Closed

Stop filterworker and outputworker from crashing #1373

wants to merge 2 commits into from

Conversation

xebab
Copy link

@xebab xebab commented May 14, 2014

When an exception is thrown during event processing, logstash may stop accepting data or crash altogether (cf. LOGSTASH-1353, LOGSTASH-1440 or LOGSTASH-1872).

I have commited two changes that make logstash continue working after encountering an exception. To test the patches, you can use the following configs.

For the filterworker case:

input {
  generator {
    lines => [
      "A%C3O",
      "foobar"
    ]
    count => 1
  }
}
filter {
  urldecode { }
  kv { }
}
output {
  stdout { }
}

For the outputworker case:

input {
  generator {
    lines => [
      "A%C3O",
      "foobar"
    ]
    count => 1
  }
}
filter {
  urldecode { }
}
output {
  stdout { codec => json {} }
}

Please consider including these patches in the next release. Thanks.

Alexander Thiel added 2 commits May 14, 2014 23:00
When individual events cause a filter to throw an exception, the
entire filterworker thread will stop accepting data. This patch puts
the exception handler inside the event processing loop to avoid this.
Individual events that cause an output plugin to throw an exception
can crash the logstash application. This patch puts an exception
handler inside the output processing loop to avoid this.
@elasticsearch-release
Copy link

Can one of the admins verify this patch?

@thomdixon
Copy link

This seems to work quite well for us. Would be nice to see it merged. @xebab can you do their whole CLA thing?

@xebab
Copy link
Author

xebab commented Jan 29, 2015

Thanks @thomdixon for pointing out this CLA issue to me. I was not aware of that. I have just signed the stuff so I hope this can get merged now.

@purbon
Copy link
Contributor

purbon commented Jan 29, 2015

@xebab The code looks good, but can you also add some test in the pipeline_spec (https://github.com/elasticsearch/logstash/blob/master/spec/core/pipeline_spec.rb) that test this functionality?

To test that you can use mocks from rspec as described https://relishapp.com/rspec/rspec-mocks/docs

@purbon
Copy link
Contributor

purbon commented Jan 29, 2015

test this please

@elasticsearch-release
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
http://build-eu-00.elasticsearch.org//job/Logstash_PR/546/
Test FAILed.

@purbon
Copy link
Contributor

purbon commented Jan 29, 2015

@xebab I was trying to test this PR and found there is no Rakefile, do you know why ? could you update the PR to be in sync with master?

@jsvd jsvd modified the milestones: v1.6.0, v1.5.1 Feb 26, 2015
@tbragin tbragin removed this from the v1.5.1 milestone Jun 10, 2015
@jordansissel jordansissel removed the O(1) label Jun 29, 2015
@elasticsearch-release
Copy link

Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'.

1 similar comment
@elasticsearch-release
Copy link

Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'.

@suyograo
Copy link
Contributor

Closing this issue since the code has deviated quite a bit and we will not be able to add this feature now.

@suyograo suyograo closed this May 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants