Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Possible error in usage of cancellationToken parameter to context.CreateTimer in AzureStorageScenarioTests.cs?

Open
#1,178 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp

Research direction

Start at test/DurableTask.AzureStorage.Tests/AzureStorageScenarioTests.cs around line 3151 and inspect the context.CreateTimer overloads and cancellation flow. Compare the arguments used there with the method signature, then run the Azure Storage scenario tests to verify whether the timer is cancelled and the orchestration completes when the approval task finishes.

Written by the indexing model from the issue text.

Description

Referring to

https://github.com/Azure/durabletask/blob/main/test/DurableTask.AzureStorage.Tests/AzureStorageScenarioTests.cs#L3151, which is:

 Task timeoutTask = context.CreateTimer(deadline, cts.Token);

The second parameter of context.CreateTimer, that should be the state, not the cancellationToken, am I right? I'm trying to understand how to use this in my own projects, and looking at the source code to understand.

In this particular scenario, the state returned from the CreateTimer is not used, so it might not be easy to spot, but shouldn't the line be:

 object dummyState = new object() // whatever, the result is not used in this example
 Task timeoutTask = context.CreateTimer(deadline, dummyState, cts.Token);

where dummyState is the state? If not, the timer will never be cancelled, even when the approval task completes, and the orchestration instance will never finish?

Or have I misunderstood how this works?

Dominant language
C#
Stars
1.7k
Forks
335
Avg merge
5d 3h
Merged PRs (30d)
8

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/durabletask

All issues in Azure/durabletask

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.