Skip to content

go 1.8 has http shutdown draining(but not for Hijacked connections) #1

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

Closed
joeblew99 opened this issue Nov 8, 2016 · 4 comments
Closed

Comments

@joeblew99
Copy link

this is nice stuff.

I noticed on the forums that go 1.8 has first class support to do draing of connections for http servers now when it gets a shutdown signal.

just thought i should mention it, because i think there might be some impact on your lib, but honestly i have not looked deeper into it.

@deankarn
Copy link
Contributor

deankarn commented Nov 8, 2016

Thanks @joeblew99

Yes I am aware 1.8 intends to have graceful shutdown, but doesn't yet handle Hijacked connection(WebSockets etc...) but this library does, please see:
golang/go#4674 (comment) and
golang/go#17721 (comment)

There is a viable workaround and I fully believe they will implement something in the future to handle this, but not in Go 1.8. When Go 1.8 is released I may adjust this libs backend accordingly, without any breaking changes, to let the STD lib handle the idle connections as they have lower level access than I have but still handle Hijacked connections.

Besides this is not just a graceful http shutdown lib, but also a net.Listener graceful shutdown for RPC and other lower level protocols and it also allows glueing together of many things for example I have a Web App that I need graceful shutdown of http including WebSocket connections, some simple CRON jobs and some other processes that are initiated by an http request but are not tied to the request itself(running in goroutine) and this library allows me to gracefully shutdown all of that using just a few lines of code. 😄

Additional: I could be wrong but I also haven't seen that the STD lib will listen for a shutdown signal, but rather exposed a function on the http.Server called Shutdown()

@deankarn deankarn changed the title go 1.8 has http shutdown draining go 1.8 has http shutdown draining(but not for Hijacked connections) Nov 11, 2016
@joeblew99
Copy link
Author

@joeybloggs thanks for explaining your use case.
I have a similar need and so will stick with your lib then..

@deankarn
Copy link
Contributor

thanks @joeblew99

in case your interested, yesterday I added functionality to provide a custom signal func https://github.com/go-playground/kms/releases/tag/v1.1.0

@joeblew99
Copy link
Author

thanks i will give it a whirl, and come back with any issues i see.

On Fri, Nov 11, 2016 at 2:38 PM Dean Karn [email protected] wrote:

thanks @joeblew99 https://github.com/joeblew99

in case your interested, yesterday I added functionality to provide a
custom signal func
https://github.com/go-playground/kms/releases/tag/v1.1.0


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALcac30I3_1V5LENFDff1oFto3Rv4QFAks5q9G_egaJpZM4KsPQy
.

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

No branches or pull requests

2 participants