Azure / Azure/durabletask

Process crashes and hangs when passing parameters that contain CancellationToken

Open
#1,158 7 comments 1 reaction 1 assignee Claimed by @AnatoliB View on GitHub
P2 reviewed
Dominant language
C#
Stars
1.7k
Forks
335
Avg merge
2d 23h
Merged PRs (30d)
6

Description

There have been several reports of CLR crashes and process hangs when using DTFx, specifically when a call to an activity function, continue-as-new, etc. passes in a parameter that contains a reference to `CancellationToken`. This also happens when `OrchestrationContext.CreateClient` is used and methods in T interface with `CancellationToken` in their signatures.

The root issue is that the serialization code used by DTFx will serialize `CancellationToken` objects in a way that can corrupt CLR memory, resulting in unexpected behavior.

The mitigation is to remove `CancellationToken` parameters from interfaces that are wrapped using `OrchestrationContext.CreateClient` or from argument values that are passed to `ScheduleTask*`, `ContinueAsNew`, etc.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.