rcrowley / goagain

Zero-downtime restarts in Go
Other
2.1k stars 144 forks source link

Make it Upstart-friendly #1

Open rcrowley opened 13 years ago

rcrowley commented 13 years ago

After talking with Paul Hammond, the following scheme would make Goagain Upstart-friendly:

Open the *net.TCPListener in the parent process and then fork a child process. The child process execs and begins accepting connections on the inherited *net.TCPListener.

When signaled SIGUSR2, the parent forks a new child. The child process execs, which loads new code from disk, and resumes accepting connections on the inherited *net.TCPListener. When this new child is operational, it signals the old child SIGQUIT to exit gracefully.

The parent process should only exit on SIGTERM and the like.

paulhammond commented 13 years ago

I hope this works.

rcrowley commented 11 years ago

https://github.com/rcrowley/upstartable-nginx is actually a pretty good and pretty generic solution to this problem. So maybe the work should be done outside goagain?

guillermo commented 11 years ago

This is to deal with upstart and runit (I think is ubuntu and arch). SystemD base systems (like redhat* and seems like debian now) solve this problem by using process groups. So the daemon is not consider died until there are no more process of the same group.

Don't know which is the perfect solution, but on any case, I think should be outside the scope of this lib.

titanous commented 10 years ago

The Double strategy solves this issue.

abourget commented 9 years ago

How experimental is that experimental Double strategy ? Anyone has experience with it ?