[Replicated] release-23.1: colexecerror: improve the catcher due to a recent regression #139
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.
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()
toruntime.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.