-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Report function name for unknown exceptions during execution #14987
Merged
gianm
merged 14 commits into
apache:master
from
kgyrtkirk:function-druid-exception-wrap
Oct 25, 2023
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
eda8e4f
provide function name when unknown exceptions are encountered
kgyrtkirk 9f59055
fix keywords/etc
kgyrtkirk 017ff4a
fix keywrod order - regex excercise
kgyrtkirk 08f1f5e
add test
kgyrtkirk 43c72fd
add check&fix keywords
kgyrtkirk 3423f6a
Merge remote-tracking branch 'apache/master' into function-druid-exce…
kgyrtkirk e922c82
decoupledIgnore
kgyrtkirk 55ad208
Revert "decoupledIgnore"
kgyrtkirk f71bdef
unpatch Function
kgyrtkirk 3567584
move to a different location
kgyrtkirk e81fbe7
checkstyle
kgyrtkirk 54d1beb
Merge remote-tracking branch 'apache/master' into function-druid-exce…
kgyrtkirk 0931995
Merge remote-tracking branch 'apache/master' into function-druid-exce…
kgyrtkirk 0507c52
Merge remote-tracking branch 'apache/master' into function-druid-exce…
kgyrtkirk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think some other category would make more sense than "defensive". Defensive is sort of like an assert (it signals that we believe this should never happen unless there's a bug) but we do in fact expect functions to throw exceptions under "normal" conditions sometimes. (Like if they receive arguments of the wrong type, etc)
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.
In case the invoked function have already thrown out some reasonable exception (
DruidException
) - that's not touched at all - because a catch above caught it.I wanted to add this to catch cases in which some unexpected issue happened while the function was processing....so that we don't let out a
NullPointerException
; instead say that "Invocation of function x encountered ... " - it may give some help to the user what might have been the problem ; and it could give better error message to support instead of just refering to it as an NPE.or do you think it would be better to repackage also normal
DruidExcpetion
-s and re-packaged? - and rethrown them with a bit more context?so it will be something like:
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.
Ah I see. I thought this was wrapping all exceptions, but misread it.
In the case I'm wondering if the "user-caused" exceptions (bad input) thrown by functions are all proper DruidExceptions? In that case a defensive might make sense here. We just want to avoid defensive for anything that isn't a code bug on our end.
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.
yes - other exceptions are good; the case was like: an unexpected issue happened - and the NPE bubbled up to the top. Giving little-to-no detail to the user about what happened; as the message didn't contained anything usefull.
I think if the user could see a bit friendlier message - it might give a starting point to either start narrowing it down the issue; or try to work it around
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.
It should surface as runtime_failure IMO. Both defensive and runtime_failure map to same error code.