-
Notifications
You must be signed in to change notification settings - Fork 24
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
DEV-32671 Grok processing should fail faster on timeout interruption #304
DEV-32671 Grok processing should fail faster on timeout interruption #304
Conversation
@DanMelman any chance it is reproducible so we can write proper test? |
There is a test for the interruption itself - |
I mean to have test that fails without fix and passes with fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good :)
didn't we want to add Thread.interrupted
check here as well?
@matvey-mtn I ended up adding it inside |
ah, ok. i missed it |
if (Thread.currentThread().isInterrupted()) { | ||
throw new InterruptedException(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have to clear the isInterrupted flag once you inside if
Thread.interrupted()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I would try to think if there is a way to add tests for really slow Grok pattern match that will cause parser to hang on previous version.
@matvey-mtn @alexpalchuk I added the test, it fails on master - 2248651 |
org.jruby.joni
library version to gain some internal changes that will allow faster interruption of grok matching (jruby/joni@35ddadc)