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

goagain does not work! #15

Closed
rbucker opened this issue Jul 10, 2013 · 3 comments
Closed

goagain does not work! #15

rbucker opened this issue Jul 10, 2013 · 3 comments

Comments

@rbucker
Copy link

rbucker commented Jul 10, 2013

Running the following httperf command... almost 4000 transactions are lost because it takes about a second to relaunch the app.

httperf --num-calls=4000 --port= 48879 --uri=/mock --num-conns=10

Looking closely at the code it's not possible to have a zero downtime.

(a) goagain shares open connection
(b) there is no state migration
(c) during the swap no new connections can be made and therefore potential transactions lost

/r

@rcrowley
Copy link
Owner

rcrowley commented Aug 4, 2013

Apologies for such a late reply, @rbucker881. I think maybe there's some omission on my part at work here. goagain doesn't make any effort to pass connections you've accepted to the new process; it only ensures the listening socket is never dropped.

https://github.com/rcrowley/goagain/blob/master/cmd/goagain-example/goagain-example.go#L64-L71 is a little bit hand-wavey but requests that you gracefully stop the process that's being restarted. For an HTTP server that means responding to the last request in-flight and closing the connection (this is certainly complicated by HTTP pipelining if you're being so exotic). Does that clear up the confusion I caused?

@rbucker
Copy link
Author

rbucker commented Aug 4, 2013

Thank you for clearing that up. Having your code to test and consider the devops requirements for a websocket environment has been valuable to me. In order to have a truly operational environment I'll need more than just a daemontools framework to restart or at least a smarter daemontools RUN.

@rbucker rbucker closed this as completed Aug 4, 2013
@rcrowley
Copy link
Owner

rcrowley commented Aug 4, 2013

I wish I could say so more authoritatively but systemd looks to be able to supervise this sort of zero-downtime restart in ways daemontools, Upstart, and the like cannot.

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