# TraconDrainOptions

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.tracondrainoptions/
> Summary: TraconDrainOptions: Graceful-shutdown draining settings.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Core.dll</code></div>

Graceful-shutdown draining settings.

```csharp
public sealed class TraconDrainOptions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.tracondrainoptions/">TraconDrainOptions</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

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

## Constructors

### <a id="Tracon_TraconDrainOptions__ctor"></a> TraconDrainOptions\(\)

```csharp
public TraconDrainOptions()
```

## Fields

### <a id="Tracon_TraconDrainOptions_SectionName"></a> SectionName

The configuration section name.

```csharp
public const string SectionName = "Tracon:Drain"
```

#### Field Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Properties

### <a id="Tracon_TraconDrainOptions_Enabled"></a> Enabled

Whether draining is on. Defaults to [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool): today's
behavior (the process stops immediately, in-flight runs are cut off)
does not change unless a setup opts in.

```csharp
public bool Enabled { get; set; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### Remarks

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.

### <a id="Tracon_TraconDrainOptions_Timeout"></a> Timeout

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

```csharp
public TimeSpan Timeout { get; set; }
```

#### Property Value

 [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)

#### Remarks

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.
