microsoft / microsoft/durabletask-mssql
Recursive purge is not recursive
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 105
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Description
Invoking DurableTaskClient.PurgeInstanceAsync with PurgeInstanceOptions.Recursive = true does not result in sub-orchestrations being purged. The documentation for this method states that sub-orchestrations should be purged when this flag is set.
Example:
var purgeInstanceOptions = new PurgeInstanceOptions
{
Recursive = true
};
await client.PurgeInstanceAsync("my_instance_id", purgeInstanceOptions);
with rows in the Instances table that have ParentInstanceID=my_instance_id (in addition to the required InstanceID=my_instance_id row that has a RuntimeStatus of Completed, Terminated, or Failed), executes the following SQL:
declare @p1 dt.InstanceIDs
insert into @p1 values('my_instance_id')
exec dt.PurgeInstanceStateByID @InstanceIDs=@p1
(Stored procedure PurgeInstanceStateByID only uses the provided InstanceIDs - it does not perform a recursive CTE.)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at DurableTaskClient.PurgeInstanceAsync and PurgeInstanceOptions. Inspect how the recursive instance ID set is passed to dt.PurgeInstanceStateByID, using the Instances rows and ParentInstanceID example as the reproduction. Done means purging a completed, terminated, or failed parent also removes its sub-orchestrations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100