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

<LocalJumpError: unexpected next> for all logs #26

Closed
cromega opened this issue Mar 31, 2016 · 8 comments
Closed

<LocalJumpError: unexpected next> for all logs #26

cromega opened this issue Mar 31, 2016 · 8 comments
Labels

Comments

@cromega
Copy link

cromega commented Mar 31, 2016

https://github.com/logstash-plugins/logstash-output-redis/blob/v2.0.4/lib/logstash/outputs/redis.rb#L236 triggers a runtime error.

@cromega
Copy link
Author

cromega commented Apr 1, 2016

Hey,

After much time spent debugging this issue I can provide some more details.

While all log entries trigger the exception to be printed to stdout the logs actually get through to Redis. The main problem is the massive amounts of error logs this bug generates.

As I pointed out in the previous comment, the bug is caused by a next call which is not within an iterator context and it causes a (sort-of) syntax error.

This error handling block, if I'm correct, is to prevent the output pipeline from blowing up in case of an error. The code correctly catches StandardError only. However, this does not work very well with JRuby.

The error JRuby raises for an out-of-context next is LocalJumpError, which inherits from StandardError, even though it should inherit from ScriptError as is the case with MRI.

In my opinion the plugin should fatally blow up when execution reaches here

The reason this bug went unnoticed during testing is the aforementioned exception catching block. During tests @logger.warn does not do anything.

I thought about issuing a PR but changing the erroneous next statement to return would not solve the underlying issue which caused this bug to go unnoticed in the first place (and it definitely wouldn't prevent similar bugs from happening in the future)

@AlexClineBB
Copy link

I was able to change the affected line in /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-redis-2.0.4/lib/logstash/outputs/redis.rb as a temporary workaround for this issue.

@blavoie
Copy link

blavoie commented Apr 7, 2016

got the same error...
what to change precisely to overcome this flood of errors?
downgraded to 2.2.2....

@cromega
Copy link
Author

cromega commented Apr 7, 2016

@blavoie: sed '236 s/next/return/' lib/logstash/outputs/redis.rb is a temporary workaround.

@blavoie
Copy link

blavoie commented Apr 8, 2016

@cromega tks
Is the bug also there in LS 2.3.x series?

@tihakkar
Copy link

@blavoie Yes. I just saw the same issue after updating to LS 2.3.1

@colinsurprenant
Copy link
Contributor

got PR #27 to fix this, I am hoping to push a new plugin version out today.

@colinsurprenant
Copy link
Contributor

pushed new plugin version 2.0.5 which should fix this issue.

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

No branches or pull requests

6 participants