cloudflare / tableflip

Graceful process restarts in Go
BSD 3-Clause "New" or "Revised" License
2.88k stars 147 forks source link

Allow multiple back-to-back graceful upgrades #52

Closed kkw825 closed 3 years ago

kkw825 commented 4 years ago

I think tableflip is a great tool. I am experimenting the tool with a TCP server which handles long-lived TCP connections. When an upgrade is started, the old process needs to wait until all the existing TCP connections are done before the old process can exit. It can take a long time to drain the long-lived connections. As a result, a further upgrade is blocked until the old process exits. I wonder if we can have a way to relax this constraint?

lmb commented 4 years ago

I'm glad it's useful :) Doing that will be really difficult I think.

From the POV of the library:

As someone deploying such an application:

Ultimately, I think that the tableflip model isn't suitable for this. I guess you could build a separate process that holds sockets and spawns new versions of your service as you go along, but at that point you're reinventing systemd to a degree. I guess you could use tableflip to build this supervisory process if you wanted to.