Class FailurePolicy
Namespace: Cephalon.Engine.Configuration
Assembly: Cephalon.Engine.dll
Describes how the runtime reacts to startup, stop, and restart failures.
public sealed class FailurePolicyInheritance
Section titled “Inheritance”Inherited Members
Section titled “Inherited Members”object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
Section titled “Constructors”FailurePolicy(StartupFailureBehavior, StopFailureBehavior, bool, int, TimeSpan, TimeSpan, TimeSpan)
Section titled “ FailurePolicy(StartupFailureBehavior, StopFailureBehavior, bool, int, TimeSpan, TimeSpan, TimeSpan)”Initializes a new instance of the
public FailurePolicy(StartupFailureBehavior startupFailureBehavior = StartupFailureBehavior.FailFast, StopFailureBehavior stopFailureBehavior = StopFailureBehavior.BestEffortContinue, bool allowManualRestart = true, int maxRestartAttempts = 3, TimeSpan startupReadinessDelay = default, TimeSpan shutdownLivenessGracePeriod = default, TimeSpan manualRestartBackoff = default)Parameters
Section titled “Parameters”startupFailureBehavior StartupFailureBehavior
How startup failures are handled.
stopFailureBehavior StopFailureBehavior
How stop failures are handled.
allowManualRestart bool
Whether operators can manually restart the runtime after supported failures.
maxRestartAttempts int
The maximum number of manual restarts, where -1 allows unlimited restarts.
startupReadinessDelay TimeSpan
The optional warmup window that keeps readiness unhealthy after startup succeeds.
shutdownLivenessGracePeriod TimeSpan
The optional drain window that keeps liveness healthy while shutdown is in progress.
manualRestartBackoff TimeSpan
The optional backoff window that delays manual restarts after a restartable failure.
Properties
Section titled “Properties”AllowManualRestart
Section titled “ AllowManualRestart”Gets a value indicating whether manual restart is allowed after supported failures.
public bool AllowManualRestart { get; }Property Value
Section titled “Property Value”Default
Section titled “ Default”Gets the default failure policy used when no explicit configuration is supplied.
public static FailurePolicy Default { get; }Property Value
Section titled “Property Value”HasValues
Section titled “ HasValues”Gets a value indicating whether this policy differs from
public bool HasValues { get; }Property Value
Section titled “Property Value”ManualRestartBackoff
Section titled “ ManualRestartBackoff”Gets the cooldown window that must elapse before a manual restart may run after a restartable failure.
public TimeSpan ManualRestartBackoff { get; }Property Value
Section titled “Property Value”MaxRestartAttempts
Section titled “ MaxRestartAttempts”Gets the maximum number of manual restarts.
public int MaxRestartAttempts { get; }Property Value
Section titled “Property Value”ShutdownLivenessGracePeriod
Section titled “ ShutdownLivenessGracePeriod”Gets the liveness grace window that applies while shutdown is still draining.
public TimeSpan ShutdownLivenessGracePeriod { get; }Property Value
Section titled “Property Value”StartupFailureBehavior
Section titled “ StartupFailureBehavior”Gets how startup failures are handled.
public StartupFailureBehavior StartupFailureBehavior { get; }Property Value
Section titled “Property Value”StartupReadinessDelay
Section titled “ StartupReadinessDelay”Gets the readiness warmup window that applies after startup succeeds.
public TimeSpan StartupReadinessDelay { get; }Property Value
Section titled “Property Value”StopFailureBehavior
Section titled “ StopFailureBehavior”Gets how stop failures are handled.
public StopFailureBehavior StopFailureBehavior { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”FromConfiguration(IConfiguration, string)
Section titled “ FromConfiguration(IConfiguration, string)”Reads the failure policy from configuration.
public static FailurePolicy FromConfiguration(IConfiguration configuration, string sectionPath = "Engine")Parameters
Section titled “Parameters”configuration IConfiguration
The configuration source that contains the engine section.
sectionPath string
The root configuration section path to read from.
Returns
Section titled “Returns”The parsed failure policy.