Use searchInterruptible for Joni regexp matching#16109
Use searchInterruptible for Joni regexp matching#16109rschlussel merged 1 commit intoprestodb:masterfrom
Conversation
b113bf4 to
9f7f21c
Compare
aweisberg
left a comment
There was a problem hiding this comment.
I tested this change from TaskExecutor and it seems to work reasonably well. I did find that it doesn't check interrupt on some regexes.
presto-main/src/main/java/com/facebook/presto/operator/scalar/JoniRegexpFunctions.java
Outdated
Show resolved
Hide resolved
Hmm - can you repro reliably? Maybe some other function handled it already before it came to Joni? |
aweisberg
left a comment
There was a problem hiding this comment.
It not always detecting interrupt is fine I just noticed that its contract is not guaranteed to throw. This means there are cases where it will execute the regex without ever checking for interrupt.
So for example you could call Thread.interrupt(), then searchInterruptible and it will complete normally.
|
Can you squash (fixup) the additional commit before it gets merged? Thanks! |
abf6701 to
c8b5adb
Compare
Done |
There was a problem hiding this comment.
@highker suggested adding Options.DEFAULT directly here instead of passing it in since it is always the same.
c8b5adb to
444dd7a
Compare
444dd7a to
20ddbd1
Compare
|
@kaikalur can you add to the test plan the manual testing you did that demonstrated that this was helpful. |
|
also, this should probably get a release note, since it caused production issues. |
|
I tested this with #16111 on this query 20210518_201931_00000_y9r9j |
See Ariel's response below. He tested it. |
|
Just add a release note, and I'll merge this. |
Done |
|
I updated the release note to be more focused on the impact of the change. Feel free to fix it if it's not accurate. |
Joni regexp search can be very slow. This can cause runaway splits issue. So we use the searchInterruptible method so it can be interrupted in such cases.
Test plan - None