# DurableTaskContext.RequestTaskCancellation(string?)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.durabletaskcontext/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.durabletaskcontext/methods/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable.Abstractions/DurableTaskContext.cs#L416-L425)

```csharp
protected internal void RequestTaskCancellation(string? reason)
```

Requests durable cancellation of the task which this context runs, carrying `reason`.

### Parameters

- `reason` (`string?`): The reason which [DurableTaskContext](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.durabletaskcontext/) reports, or `null` for none. The first request determines the reason, so a host which replays a canceled task passes the reason it recorded with the task's cancellation.
