Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Cardano.Node.Handlers.Shutdown
Synopsis
- data ShutdownOn
- = ASlot !SlotNo
- | ABlock !BlockNo
- | NoShutdown
- parseShutdownOn :: Parser ShutdownOn
- data ShutdownConfig = ShutdownConfig {
- scIPC :: !(Maybe Fd)
- scOnSyncLimit :: !(Maybe ShutdownOn)
- withShutdownHandling :: ShutdownConfig -> Tracer IO ShutdownTrace -> IO () -> IO ()
- data ShutdownTrace
- maybeSpawnOnSlotSyncedShutdownHandler :: HasHeader (Header blk) => ShutdownConfig -> Tracer IO ShutdownTrace -> ResourceRegistry IO -> ChainDB IO blk -> IO ()
Documentation
data ShutdownOn Source #
Constructors
ASlot !SlotNo | |
ABlock !BlockNo | |
NoShutdown |
Instances
parseShutdownOn :: Parser ShutdownOn Source #
Generalised shutdown handling
data ShutdownConfig Source #
Constructors
ShutdownConfig | |
Fields
|
Instances
Show ShutdownConfig Source # | |
Defined in Cardano.Node.Handlers.Shutdown | |
Eq ShutdownConfig Source # | |
Defined in Cardano.Node.Handlers.Shutdown Methods (==) :: ShutdownConfig -> ShutdownConfig -> Bool Source # (/=) :: ShutdownConfig -> ShutdownConfig -> Bool Source # |
Arguments
:: ShutdownConfig | |
-> Tracer IO ShutdownTrace | |
-> IO () | Action to potentially shutdown via file descriptor |
-> IO () |
We provide an optional cross-platform method to politely request shut down.
The parent process passes us the file descriptor number of the read end of a pipe,
via the CLI with --shutdown-ipc FD
data ShutdownTrace Source #
Constructors
ShutdownRequested | Received shutdown request |
AbnormalShutdown | Non-isEOFError shutdown request |
ShutdownUnexpectedInput Text | Received shutdown request but found unexpected input in --shutdown-ipc FD: |
RequestingShutdown Text | Ringing the node shutdown doorbell for reason |
ShutdownArmedAt ShutdownOn | Will terminate upon reaching a ChainDB sync limit |
Instances
Watch ChainDB for passing a configured slot sync limit threshold,
maybeSpawnOnSlotSyncedShutdownHandler :: HasHeader (Header blk) => ShutdownConfig -> Tracer IO ShutdownTrace -> ResourceRegistry IO -> ChainDB IO blk -> IO () Source #
Spawn a thread that would cause node to shutdown upon ChainDB reaching the configuration-defined slot.