Skip to content
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

[Replicated] release-23.1: colexecerror: improve the catcher due to a recent regression #139

Merged
merged 1 commit into from
Jan 11, 2025

Conversation

mohini-crl
Copy link
Owner

Replicated from original PR cockroachdb#133634

Original author: blathers-crl[bot]
Original creation date: 2024-10-29T00:28:50Z

Original reviewers: michae2

Original description:

Backport 1/1 commits from cockroachdb#133620 on behalf of @yuzefovich.

/cc @cockroachdb/release


Earlier this year we made the vectorized panic-catcher much more efficient (in cockroachdb#123277) by switching from using debug.Stack() to runtime.CallersFrames. It appears that there is slight difference in the behavior between the two: the former omits frames from within the runtime (only a single frame for the panic itself is included) whereas the latter keeps the additional runtime frames. As a result, if a panic occurs due to a Go runtime internal violation (e.g. invalid interface assertion) it is no longer caught to be converted into an internal CRDB error and now crashes the server. This commit fixes this regression by skipping over the frames that belong to the Go runtime. Note that we will do so only for up to 5 frames within the runtime, so if there happens to be more deeply-nested panic there, we'll still crash the CRDB server.

Fixes: cockroachdb#133617.

Release note: None


Release justification: stability regression fix.

Earlier this year we made the vectorized panic-catcher much more
efficient (in cockroachdb#123277) by switching from using `debug.Stack()` to
`runtime.CallersFrames`. It appears that there is slight difference in
the behavior between the two: the former omits frames from within the
runtime (only a single frame for the panic itself is included) whereas
the latter keeps the additional runtime frames. As a result, if a panic
occurs due to a Go runtime internal violation (e.g. invalid interface
assertion) it is no longer caught to be converted into an internal CRDB
error and now crashes the server. This commit fixes this regression by
skipping over the frames that belong to the Go runtime. Note that we
will do so only for up to 5 frames within the runtime, so if there
happens to be more deeply-nested panic there, we'll still crash the CRDB
server.

Release note: None
@mohini-crl mohini-crl merged commit 1d0388e into master Jan 11, 2025
1 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

colexecerror: some runtime panics are no longer recovered from
2 participants