Skip to main content

shutdown_plan

Function shutdown_plan 

Source
pub fn shutdown_plan(total: Duration, backup_bound: Duration) -> ShutdownPlan
Expand description

Divide total between the phases. backup_bound is the backup’s own shutdown bound (BackupConfig::shutdown_budget), zero without backup.

With room (total at least drain cap + 8 s + backup_bound) the drain gets its cap, the backup its bound, and the snapshot the rest. With less, all three scale down in proportion, except that the backup keeps a floor ([SHUTDOWN_BACKUP_FLOOR], never more than its bound) and the drain gives way first: it is the phase a stuck client can stretch.