Feature Request: Support Systemd Socket Activation (Zero-Downtime Restarts) #2087

Open
opened 2026-08-01 23:13:34 +00:00 by kira-bruneau · 1 comment

Systemd socket activation would allow for zero-downtime restarts. See:

Specifically, systemd would allocate a TCP/Unix socket before the service starts, buffer any data sent to the socket before the service is ready to process it, and then hand down the socket to continuwuity. Then during restarts, the socket would be reclaimed by systemd, and any data would be buffered again until the service is back up and ready to process it.

Socket activation is more commonly used to deffer starting services until the first request is made, but I think for continuwuity it would be preferable to default to starting the service before any requests are made.

Something like https://crates.io/crates/tokio-listener could help generalize all the different ways connections could be accepted, but it would require a bit of refactoring to use.

Something like https://crates.io/crates/sd-listen-fds would be simpler to add, but would require some more special-case code to use.

Systemd socket activation would allow for zero-downtime restarts. See: - https://www.freedesktop.org/software/systemd/man/latest/systemd.socket.html - https://www.freedesktop.org/software/systemd/man/latest/sd_listen_fds.html Specifically, systemd would allocate a TCP/Unix socket before the service starts, buffer any data sent to the socket before the service is ready to process it, and then hand down the socket to continuwuity. Then during restarts, the socket would be reclaimed by systemd, and any data would be buffered again until the service is back up and ready to process it. Socket activation is more commonly used to deffer starting services until the first request is made, but I think for continuwuity it would be preferable to default to starting the service before any requests are made. Something like https://crates.io/crates/tokio-listener could help generalize all the different ways connections could be accepted, but it would require a bit of refactoring to use. Something like https://crates.io/crates/sd-listen-fds would be simpler to add, but would require some more special-case code to use.
Owner

I was looking at this yesterday actually and would definitely be interested in seeing it supported

I was looking at this yesterday actually and would definitely be interested in seeing it supported
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity#2087
No description provided.