Skip to content
Tracon

TraconDrainOptions

Namespace Tracon · Assembly Tracon.Core.dll

Graceful-shutdown draining settings.

public sealed class TraconDrainOptions
Inheritance
object ← TraconDrainOptions
Inherited Members
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). Two backup mechanisms actually carry that guarantee: the HTTP host’s own Kestrel request draining, and the job worker’s own WaitForRunningJobsAsync drain loop. A setup that relies on this flag alone, without one of those two layers in its own request path, has no closed guarantee against a run starting in that narrow window.

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.

Must be from one millisecond to about 49.7 days; any other value fails at startup.