-
Notifications
You must be signed in to change notification settings - Fork 68
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
Improve Python exception handling in user provided functions #2194
Conversation
We should also do these checks in |
The current work looks fine. A few |
I think we should do a single worker test to make sure there is no large performance change. This is all hotpath. |
@aturley addressed in the last commit, can be confirmed by including the exception in |
@@ -154,7 +154,9 @@ class PyStateBuilder | |||
_state_builder = state_builder | |||
|
|||
fun apply(): PyState => | |||
PyState(@state_builder_build_state(_state_builder)) | |||
let py_state = @state_builder_build_state(_state_builder) |
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.
Don't forget to call print_errors()
.
Other than the comment about printing errors this looks good. Once you fix that you should do a single worker test. |
c553e0d
to
d25e467
Compare
@aturley |
@JONBRWN looks good to me. |
thanks @aturley, I'll squash and merge |
Adds null checks around the returned object of user provided functions and fails if the returned object is NULL. This stops us from segfaulting and provides an immediate error as opposed to the error propagating up further down the pipeline when we attempt to use the NULL object. Add null check for encoded string in Machida's TCPSinkEncoder Verifies that the string we're outputting is infact a string so we do not segfault if the user provides an encoder function that does not return a string.
c73b586
to
c90a9bb
Compare
Adds null checks around the returned object of user provided functions
and fails if the returned object is
NULL
. This stops us fromsegfaulting and provides an immediate error as opposed to the error
propagating up further down the pipeline when we attempt to use the
NULL
object.Addresses: #2180 #2184
I'm pretty sure I got all cases, but if I missed something, let me know.
To test, apply this diff and comment in the exception you want to test: