Feature Request: Support Systemd Socket Activation (Zero-Downtime Restarts) #2087
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
bob the builder
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
continuwuation/continuwuity#2087
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
I was looking at this yesterday actually and would definitely be interested in seeing it supported