braintree / manners

A polite Go HTTP server that shuts down gracefully.
MIT License
997 stars 103 forks source link

Reject requests via kept alive connections after close #32

Closed horkhe closed 8 years ago

horkhe commented 8 years ago

Problem

After a graceful server is stopped, kept alive connections are left hanging. Each of them allow one more request to be processed, after that they are closed thanks to SetKeepAlivesEnabled(false). But that one request (per connection) can still screw things up if e.g. it sends to a channel that you already closed since supposedly the http server has stopped gracefully.

Solution

Graceful server should ignore requests received via kept alive connections after server shutdown.

horkhe commented 8 years ago

@lionelbarrow could you please take a look and let me know what you think. Thank you.

lionelbarrow commented 8 years ago

@horkhe Yep, I'll try to take a look this weekend.

lionelbarrow commented 8 years ago

This looks good to me. Thanks!