Skip to content
Tracon

TraconDrainOptions

Namespace Tracon · Assembly Tracon.Core.dll

Graceful-shutdown draining settings.

public sealed class TraconDrainOptions

objectTraconDrainOptions

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

Read from the Tracon:Drain configuration section. See TraconServiceCollectionExtensions.AddTracon.

public TraconDrainOptions()

The configuration section name.

public const string SectionName = "Tracon:Drain"

string

Whether draining is on. Defaults to false: today’s behavior (the process stops immediately, in-flight runs are cut off) does not change unless a setup opts in.

public bool Enabled { get; set; }

bool

Turning this on does not, by itself, close the register/accept race window a new run can land in right as shutdown begins (BL-026) — see ITraconDrainState’s remarks for the two backup mechanisms (Kestrel request draining, the job worker’s own WaitForRunningJobsAsync) that actually carry that guarantee.

The longest time to wait for in-flight runs to finish before the process stops anyway.

public TimeSpan Timeout { get; set; }

TimeSpan

The host’s own HostOptions.ShutdownTimeout (default 30 s) still applies on top of this value and can cut the wait short; a setup that wants the full wait to take effect raises both together.