SHUTDOWN
Syntax
SHUTDOWN [SAVE | NOSAVE | SAFE] [NOW] [FORCE] [ABORT]
Time complexity: O(1)
ACL categories: @admin, @slow, @dangerous
Options
The SHUTDOWN command supports optional modifiers to alter the behavior of the command:
SAVEwill force a DB saving operation even if no save points are configured.NOSAVEwill prevent a DB saving operation even if one or more save points are configured.SAFEis accepted for Valkey compatibility and is treated the same asSAVE.NOWperforms a fast shutdown. Dragonfly will attempt to accelerate shutdown and may close client connections sooner.FORCEperforms a fast shutdown and ensures no snapshot is created during shutdown. This overridesSAVE/SAFEand is equivalent to combining fast shutdown with a no-save behavior.ABORTis not supported in Dragonfly. SupplyingABORTreturns an error, and the server remains running.
Notes
SAVEandNOSAVEare mutually exclusive. Supplying both results in a syntax error.FORCEtakes precedence overSAVE/SAFEandNOSAVEregarding snapshot behavior.
Signal Handling
- If Dragonfly receives one of the signals
SIGTERMandSIGINT, the sameSHUTDOWNsequence is performed. - See also Signal Handling.
Return
- On successful shutdown, nothing is returned since the server quits and the connection is closed.
- If
ABORTis specified, Dragonfly returns an error:SHUTDOWN ABORT is not supported, and the server remains running. - On other failures (e.g., invalid option combinations), an error is returned.