Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graceful restart to keep connections open

Tags:

go

restart

I am sure I saw some open source server written in Go that was able to restart and keep connections open.

I can't find it to learn that technique.

I know apache.httpd has apachectl graceful that restarts and keeps connections open.

How does it done in general and in Go?

I thought it must fork and 1 exit, 2 exec(new go app) and link connections by Fd.

But in Go I can find only ForkExec function. I think Fork is required. Also syscall package is not very well documented.

like image 519
Artem Avatar asked Feb 12 '13 23:02

Artem


1 Answers

CloseOnExec may help,

FileListener, CloseOnExec and gracefully restarting servers

Zero Downtime upgrades of TCP servers in Go

like image 125
Joe Avatar answered Oct 06 '22 17:10

Joe