-
Notifications
You must be signed in to change notification settings - Fork 38.6k
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
Propagate panics up handler chain #71076
Conversation
/assign lavalamp sttts |
/priority critical-urgent |
e295a2f
to
0b39f63
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
0b39f63
to
57e7e3c
Compare
const size = 64 << 10 | ||
buf := make([]byte, size) | ||
buf = buf[:goruntime.Stack(buf, false)] | ||
panicReason = fmt.Sprintf("%v\n%s", panicReason, string(buf)) |
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.
trim trailing newline
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.
Makes concatenation of further backtraces cleaner
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.
done
57e7e3c
to
0952c9e
Compare
/milestone v1.13 |
/lgtm |
/retest |
1 similar comment
/retest |
/cc @roycaihw |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Fixes panic propagation in
finishRequest
. finishRequest incorrectly assumed that HandleCrash was the correct way to recover a panic in order to propagate it up the handler chain. In actuality, HandleCrash simply logs and repanics, which causes the process to exit in finishRequest, which means we don't get the full call stack. We want to capture the panic reason/stack, and propagate it upward so the full stack is logged at the top of the handler chain.Special notes for your reviewer:
Does this PR introduce a user-facing change?: