Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

add recovery in top level handler #741

Merged
merged 2 commits into from
Jul 24, 2017

Conversation

jaffee
Copy link
Member

@jaffee jaffee commented Jul 19, 2017

Overview

Previously, if Pilosa experienced a panic while handling a request, it would print the stack trace, abort handling of the current request, and continue handling other requests as normal - the client was left in the lurch with an unexpected EOF. This PR recovers from all panics in handlers explicitly and returns an internal server error to the client along with a stack trace so the client may handle the failure more gracefully.

Fixes #

Pull request checklist

Code review checklist

This is the checklist that the reviewer will follow while reviewing your pull request. You do not need to do anything with this checklist, but be aware of what the reviewer will be looking for.

  • Ensure that any changes to external docs have been included in this pull request.
  • If the changes require that minor/major versions need to be updated, tag the PR appropriately.
  • Ensure the new code is properly commented and follows Idiomatic Go.
  • Check that tests have been written and that they cover the new functionality.
  • Run tests and ensure they pass.
  • Build and run the code, performing any applicable integration testing.

@@ -29,6 +29,7 @@ import (
"net/http"
_ "net/http/pprof"
"os"
"runtime/debug"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there excessive overhead from this import, or some other drawback?

@jaffee jaffee merged commit 2480073 into FeatureBaseDB:master Jul 24, 2017
@alanbernstein alanbernstein mentioned this pull request Jul 27, 2017
12 tasks
@jaffee jaffee deleted the 707-catch-panics branch June 20, 2018 00:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants