ResourceNotFound exception during concurrent orchestrationService.PurgeInstanceHistoryAsync call

Open
#1,210 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
azure, csharp

Research direction

Start with PurgeInstanceHistoryAsync in src/DurableTask.AzureStorage/AzureStorageOrchestrationService.cs and the tracking-store deletion logic in src/DurableTask.AzureStorage/Tracking/AzureTableTrackingStore.cs. Investigate concurrent purge calls for the same instances and determine whether ResourceNotFound is expected; done requires an agreed fix or documented guidance for concurrent cleanup.

Written by the indexing model from the issue text.

Description

Problem statement

We have implemented a background clean up service that cleans up orchestrations in terminal state using the orchestrationService.PurgeInstanceHistoryAsync https://github.com/Azure/durabletask/blob/6d09d0353383e25caba94bdee862532b6175a847/src/DurableTask.AzureStorage/AzureStorageOrchestrationService.cs#L1986 periodically every 12 hrs. We recently got DurableTaskStorageException with an inner exception of TableTransactionFailedException with error code ResourceNotFound.

Setup
  • The background clean up service runs on multiple pods and therefore there can be Purge call on same instance multiple times.
  • Each orchestration instance has 6-7 activities.
Investigation findings

Possible solutions

  • Is it advised to clean up orchestration once it is completed? This would reduce the load on the background clean up service and even remove its requirement altogether.
  • We could move the background clean up to a separate service altogether (right now it is running in the same service that has orchestration logic), but could that impact locks and produce latencies in already running orchestration? I believe not as there is no locking logic in the purge call.
  • Is there any general advice on performing purge of the instances?
Dominant language
C#
Stars
1.7k
Forks
335
Avg merge
4d 2h
Merged PRs (30d)
6

Contributor guide

No contributing guide indexed for this repository

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.