-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
opt: remove panics in execbuilder #99981
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
I've added the backport label because I think this reduces the risk of uncaught panics, but let me know if you disagree. |
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.
Do you envision that we'll both keep the existing panic-catching mechanism where it is already present and also prohibit the usage of error propagation via panics? Should we still then introduce panic injection as Drew's PR does? Should we introduce a linter to prohibit the usage of panic
s in some optimizer packages?
I don't have too strong of an opinion here, but in the vectorized engine I think the panic-catching mechanism of error propagation worked well for us (in comparison to row-by-row engine we're more likely to return an internal error in some unexpected state rather than crash), so I'd lean towards flushing out all the places where Optimize
is invoked. It took us some time to do that in the vectorized engine, but I think we now have panic-catches in all (or at least in the most important) places, so personally I'd put more focus on flushing those callsites out.
Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @DrewKimball)
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.
If we decide to go with this method.
Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @mgartner)
56f7799
to
5b14c23
Compare
I don't envision getting rid of most of the panics or panic-catching within the optimizer. But we need to have a more confident understand and respect for which functions can panic and which cannot. All of execbuilder lives outside the panic-catching of the |
I think this is orthogonal to Drew's panic injector, which will help us find uncaught panics in other parts of the optimizer. |
5b14c23
to
7e7f5ee
Compare
This commit replaces `panic`s in execbuilder with returned errors. This is safer because execbuilder functions are invoked outside the panic-recoverable `Optimizer.Optimize` function. Release note: None
7e7f5ee
to
04f7b0e
Compare
Ok, SGTM. |
bors r+ |
Build succeeded: |
This commit replaces
panic
s in execbuilder with returned errors. Thisis safer because execbuilder functions are invoked outside the
panic-recoverable
Optimizer.Optimize
function.Informs #98786
Release note: None