Announcing ecdysis: Graceful Restarts in Rust
Updating network services without dropping active connections is a challenge. How do you deploy new code or configuration changes while maintaining zero downtime? This is where graceful restarts come in, and I'm excited to announce that we are Open Sourcing ecdysis, a Rust library for graceful process restarts originally written for data-plane services at Cloudflare.
ecdysis | ˈekdəsəs |
noun
the process of shedding the old skin (in reptiles) or casting off the outer cuticle (in insects and other arthropods).

The library enables zero-downtime upgrades through process handoff and socket inheritance. It provides four key guarantees: (1) no old code remains running after a successful upgrade; (2) the new process has a grace period for initialization; (3) crashing during initialization is safe; and (4) only a single upgrade runs in parallel at any time.
ecdysis is already battle-tested in production at Cloudflare, where it saves thousands (if not hundreds of thousands!!) of requests from being dropped whenever important edge services are upgraded.
The library specializes in socket inheritance and rebinding, making it ideal for network services that need to maintain active connections across restarts.
It supports both synchronous and asynchronous (tokio.rs) workflows, and integrates cleanly with systemd through support for systemd-notify and named sockets.
This is a collaborative project from Cloudflare's Argo Smart Routing and Orpheus team (where Yours Truly is an IC). If your Rust service needs graceful restarts, I invite you to try out ecdysis:
Issues and PRs are welcome. I look forward to your feedback and contributions!