Feature Request: Graceful Reloads and Maintenance Mode
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reading the existing graceful shutdown lifecycle and the application entry point; the issue does not name their files. Then investigate how the server manages listening sockets, process startup, and maintenance responses. Done means graceful reloads and persistent maintenance mode work as described, including startup failure recovery and draining requests; the scope requires design across several lifecycle and deployment concerns.
Written by the indexing model from the issue text.
Description
Motivation
One of the advantages of traditional Laravel applications is the simplicity of deploying updates to production.
It would be great for Laravel Rust to provide native graceful reloads and maintenance mode, allowing developers to deploy applications on a VPS or bare-metal server without requiring blue/green reverse proxy configs, containers, or external deployment orchestration.
Since Laravel Rust already supports graceful shutdown, these features could build upon the existing application lifecycle.
1. Graceful Reloads
Introduce a command such as:
laravel reload
Alternatively, support sending a SIGUSR2 signal to the running application.
The reload mechanism would:
- Start a new process using the updated binary.
- Pass the existing listening sockets to the new process.
- Wait until the new application has successfully booted.
- Stop accepting new connections in the old process.
- Allow the new process to handle all incoming connections.
- Gracefully drain existing requests and connections in the old process.
- Terminate the old process once draining is complete.
If the new process fails to initialize, the old process should continue serving traffic without interruption.
2. Maintenance Mode
Introduce commands similar to Laravel PHP:
laravel down
laravel up
Maintenance mode could provide:
- A customizable maintenance page.
- HTTP 503 responses for incoming requests (configurable with a parameter so
200also works) - JSON responses for API requests.
- Configurable
Retry-Afterheaders. - Secret-based maintenance mode bypass.
- Persistent maintenance state across process reloads and restarts.
- Graceful draining of existing application requests.
- Pausing application-managed queue workers and scheduled tasks where applicable.
Ideally, the down command should optionally wait until all active application requests and relevant background jobs have finished, allowing database migrations to run safely without concurrent application activity.
laravel down --wait
Maintenance responses should be served before executing application middleware or accessing the database.
3. Example Deployment Workflows
Zero-downtime deployment
For deployments that do not introduce breaking changes:
git pull
cargo build --release
# Atomically replace the production binary
mv myapp.new myapp
laravel reload
Deployment requiring maintenance
For deployments involving breaking database migrations or other incompatible changes:
git pull
cargo build --release
laravel down --wait
# Atomically replace the production binary
mv myapp.new myapp
# Run database migrations using the new release
laravel reload
laravel up
Throughout this process, visitors would receive a maintenance page rather than connection errors or application exceptions.
If migrations or the reload fail, the application should remain in maintenance mode until the issue is resolved.
Implementation Considerations
- Listening socket inheritance to preserve the TCP accept queue.
- Readiness handshake between old and new processes.
- Integration with the existing graceful shutdown lifecycle.
- Persistent maintenance state shared between application processes.
- Proper handling of WebSockets, SSE, and long-lived connections.
- Coordination with queue workers and scheduled tasks.
- Compatibility with process supervisors such as systemd.
- Prevention of overlapping reload operations.
- Recovery when a new binary fails to initialize.
Benefits
- Native zero-downtime deployments.
- Safe maintenance windows for breaking database migrations.
- Minimal infrastructure requirements.
- No dropped in-flight requests during normal deployments.
- Familiar deployment experience for existing Laravel PHP developers.
- Consistent application lifecycle management.
- Simpler self-hosted production environments.
- Dominant language
- Rust
- Stars
- 847
- Forks
- 174
- Avg merge
- 5h 40m
- Merged PRs (30d)
- 167
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from laravel/rust-framework
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
laravel/rust-framework#864 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
laravel/rust-framework#876 ·
Maintainers usually reply within 1 day
-
Case-sensitive contains, starts_with and ends_with that match % and _ literally on every databaseOpen
Difficulty 4/5 3-5 days Newbie friendliness 58/100
laravel/rust-framework#874 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
laravel/rust-framework#873 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 58/100
laravel/rust-framework#872 ·
Maintainers usually reply within 1 day
All issues in laravel/rust-framework
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
neuralmagic/crucible#579 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
eclipse-score/kyron#249 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
seanmonstar/reqwest#3157 ·
Maintainers usually reply within 2 days