goagain icon indicating copy to clipboard operation
goagain copied to clipboard

Make it Upstart-friendly

Open rcrowley opened this issue 14 years ago • 5 comments

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.

rcrowley avatar Sep 09 '11 19:09 rcrowley

I hope this works.

paulhammond avatar Sep 09 '11 20:09 paulhammond

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?

rcrowley avatar Mar 26 '13 03:03 rcrowley

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.

guillermo avatar Jun 04 '13 23:06 guillermo

The Double strategy solves this issue.

titanous avatar Apr 19 '14 18:04 titanous

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

abourget avatar May 05 '15 18:05 abourget