ข้ามไปยังเนื้อหา

Class FailurePolicy

เนื้อหานี้ยังไม่ได้แปลเป็นภาษาไทย แสดงเป็นภาษาอังกฤษแทน

Namespace: Cephalon.Engine.Configuration
Assembly: Cephalon.Engine.dll

Describes how the runtime reacts to startup, stop, and restart failures.

public sealed class FailurePolicy

objectFailurePolicy

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

FailurePolicy(StartupFailureBehavior, StopFailureBehavior, bool, int, TimeSpan, TimeSpan, TimeSpan)

Section titled “ FailurePolicy(StartupFailureBehavior, StopFailureBehavior, bool, int, TimeSpan, TimeSpan, TimeSpan)”

Initializes a new instance of the class.

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)

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.

Gets a value indicating whether manual restart is allowed after supported failures.

public bool AllowManualRestart { get; }

bool

Gets the default failure policy used when no explicit configuration is supplied.

public static FailurePolicy Default { get; }

FailurePolicy

Gets a value indicating whether this policy differs from .

public bool HasValues { get; }

bool

Gets the cooldown window that must elapse before a manual restart may run after a restartable failure.

public TimeSpan ManualRestartBackoff { get; }

TimeSpan

Gets the maximum number of manual restarts.

public int MaxRestartAttempts { get; }

int

Gets the liveness grace window that applies while shutdown is still draining.

public TimeSpan ShutdownLivenessGracePeriod { get; }

TimeSpan

Gets how startup failures are handled.

public StartupFailureBehavior StartupFailureBehavior { get; }

StartupFailureBehavior

Gets the readiness warmup window that applies after startup succeeds.

public TimeSpan StartupReadinessDelay { get; }

TimeSpan

Gets how stop failures are handled.

public StopFailureBehavior StopFailureBehavior { get; }

StopFailureBehavior

FromConfiguration(IConfiguration, string)

Section titled “ FromConfiguration(IConfiguration, string)”

Reads the failure policy from configuration.

public static FailurePolicy FromConfiguration(IConfiguration configuration, string sectionPath = "Engine")

configuration IConfiguration

The configuration source that contains the engine section.

sectionPath string

The root configuration section path to read from.

FailurePolicy

The parsed failure policy.