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

Recover from panics during request forwarding #3072

Merged
merged 3 commits into from
Jul 28, 2017

Conversation

jefferai
Copy link
Member

When request forwarding, if we have a panic, the entire connection gets killed. Instead, log an error with the panic information.

Fixes #2877

Note: fix is currently incomplete for the full issue.

gRPC doesn't have a handler for recovering from a panic like a normal
HTTP request so a panic will actually kill Vault's listener. This
basically copies the net/http logic for managing this.

The SSH-specific logic is removed here as the underlying issue is caused
by the request forwarding mechanism.
@jefferai jefferai added this to the 0.8.0 milestone Jul 27, 2017
@chrishoffman chrishoffman self-assigned this Jul 28, 2017
@chrishoffman
Copy link
Contributor

@jefferai the initial panic recovery worked it just was casting to the wrong type. I was able to recreate the issue and address it by casting it to a string and returning the correct error. I can't assign you as a reviewer since you created this PR. Can you take a look?

@jefferai
Copy link
Member Author

Hah, ok. Perfect. Looks great!

@chrishoffman chrishoffman self-requested a review July 28, 2017 01:53
@chrishoffman chrishoffman merged commit b5cabc2 into master Jul 28, 2017
@chrishoffman chrishoffman deleted the req-forwarding-recover branch July 28, 2017 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic/crash on "unknown cert key type ssh-rsa-cert-v01@openssh.com"
2 participants