braintree / manners

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

Disable keep-alives in shutdown hander #23

Closed ryanbrainard closed 9 years ago

ryanbrainard commented 9 years ago

If a persistent connection is before shutdown, the client will continue to be able to make requests to the server and block the shutdown because the ConnState never changes to http.StateClosed. This disables keep-alives on the server during the shutdown routine, which is recommended in the net/http docs for servers in the process of shutting down.

klizhentas commented 9 years ago

@ryanbrainard I'd also recommend taking a look at @gwatts PR #22, that has this feature alongside with adding some additional tracking of connections.

ryanbrainard commented 9 years ago

@klizhentas Yeah, I noticed that after I submitted my PR. I'll close this in favor of PR #22.