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
Fix NPE in ScriptService when script file with no extension is deleted #7953
Fix NPE in ScriptService when script file with no extension is deleted #7953
Conversation
listener.onFileCreated(file); | ||
} | ||
} catch (Throwable t) { | ||
logger.warn(""); |
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.
maybe log something here?
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.
This seems dangerous? Shouldn't this be similar to the other try/catches below?
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.
Yeah, I missed it somehow. Fixed.
left one comment - other than that LGTM - shoud this go into 1.3 too? |
The NPE fix, and test look good to me. But do we really need these try/catches around listeners? Aren't all the listeners impl details of our system? I'm afraid we will just silently ignore bugs in them then, instead of actually catching them. |
@rjernst because these listeners are called on a separate scheduled thread, catching and logging these failures earlier on the stacktrace allows as to isolate the failure easier. The tricky part about #7689 was that it was caused by an uncaught exception within listener in ScriptService. This exception wasn't mentioned anywhere in the ticket but it essentially messed up logic of the resource watcher and caused it to fail on every check afterwards with the error that was reported in the bug. So, I think this change (besides improving resource checker resiliency) will actually help us to find bugs easier. I have updated the ticket with missed logging statement and improved test a bit to include a check that ScriptService is actually functional. If v1.3.5 will ever happen I would love to see this fix there. This bug is kind of annoying. |
LGTM |
812bd07
to
384114f
Compare
I didn't push it into 1.3 branch because 1.3 branch is missing changes added #6896 that this fix is relying on. |
no worries - thanks! |
Fixes #7689