Feature Request: Graceful Reloads and Maintenance Mode
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 847
- Fork
- 174
- Merge medio
- 5h 40m
- PR unite (30g)
- 167
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di laravel/rust-framework
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
laravel/rust-framework#864 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 64/100
laravel/rust-framework#876 ·
I maintainer di solito rispondono entro 1 giorno
-
Case-sensitive contains, starts_with and ends_with that match % and _ literally on every databaseAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
laravel/rust-framework#874 ·
I maintainer di solito rispondono entro 1 giorno
-
Unicode case-insensitive like and contains on SQLite (or a hook to register SQLite functions)Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
laravel/rust-framework#873 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
laravel/rust-framework#872 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di laravel/rust-framework
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
neuralmagic/crucible#579 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
eclipse-score/kyron#249 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
seanmonstar/reqwest#3157 ·
I maintainer di solito rispondono entro 2 giorni