Using disposable objects in Orchestration functions
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- distributed-systems
Research direction
Start by reproducing the orchestration replay behavior described in the issue, focusing on the IDisposable scope around the awaited activity calls. Document when the scope is created and disposed during replay, and explain the correct pattern for logging and instrumentation so the collected data remains accurate.
Written by the indexing model from the issue text.
Description
Is there any guidance on how to correctly use objects that implement IDisposable in Orchestration functions?
Let's consider something like this:
using (IActivityScope scope = _activityScopeFactory.CreateScope())
{
await context.CallActivityAsync("TestActivity1");
await context.CallActivityAsync("TestActivity2");
// (...) etc.
}
Unless we're doing something wrong, the current behavior we're observing is that the scope object will be created multiple times, every time the orchestration is re-run to be replayed when the various activity complete. However, the Dispose on said scope only ever gets called once, as the orchestration completes?
Is there a way to somehow get it to always run?
We're doing this for logging and instrumentation, so there's no risk of leaking expensive stuff, but it's still quite annoying because the data we gather with this flow is just not correct. We'd love to get any insight on how to do it the right way.
- 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
- 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.
More from Azure/durabletask
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Azure/durabletask#1398 · 2 comments ·
-
Azure/durabletask#1389 · 1 comment · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 74/100
Azure/durabletask#1376 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Azure/durabletask#1378 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Azure/durabletask#1332 ·
All issues in Azure/durabletask
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·