Comments (7)
Hi @sagimar: thanks for reaching out.
I think I need more context here: when you say that "In the current implementation, the orchestration is actually being triggered twice", do you mean that you're seeing the orchestration being triggered twice one after the other, or do you mean in parallel? Just trying to get clarity around the current behavior you're seeing. Any traces that you may share will help me understand your requirements.
from durabletask-dotnet.
Hi, thanks for the response!
I'll further explain the issue:
I'm making the following calls (scheduling the same orchestration id twice):
public async Task ScheduleOrchestrations()
{
await client.ScheduleNewOrchestrationInstanceAsync("orchestrationId", input, options, cancellationToken).ConfigureAwait(false);
await client.ScheduleNewOrchestrationInstanceAsync("orchestrationId", input, options, cancellationToken).ConfigureAwait(false);
}
The expected behavior: Creation of one orchestration from the first call, and no-op in the second call (idempotence).
The behavior- this is the logs I see from my service:
- Fetched instance status - RuntimeStatus: NotFound
- Sending [ExecutionStarted] message, SequenceNumber: 1
- Updated instances table and set the runtime status to 'Pending'
- Fetched instance status - RuntimeStatus: Pending
- Sending [ExecutionStarted] message, SequenceNumber: 2
- Updated instance table and set the runtime status to 'Pending'
Logs 1-3 are from the first call and 4-6 are from the seconds call. Same happens also if the orchestration was in 'Running' state.
I would expect that after log number (4)- no-op will occur. This could be achieved using dedupeStatuses functionality from azure/durabletask (it will throw an exception instead of sending ExecutionStarted event and updating the instance table).
Thanks!
from durabletask-dotnet.
Just to confirm, you're saying that you sometimes see an orchestrator already in the Running
state get set back to Pending
when you call await client.ScheduleNewOrchestrationInstanceAsync
?. That seems like a bug to me. The case where Pending
is set again to Pending
seems safe enough, but the former case is more problematic.
from durabletask-dotnet.
Yes- this is absolutely what happens (even not sometimes, using storage).
But more than that, I would also want to have the ability to control the idempotence level, so for example also if the state is 'Completed' (also 'Pending' in my opinion)- it won't re-schedule the orchestration.
from durabletask-dotnet.
@davidmrdavid - any update on this? this is a blocking bug since it breaks the idempotency. As far as I understand from @sagimar comment above, this is a very easy fix on your side (just to expose the extra parameter and call the the method's overload).
Is there an ETA for the fix?
from durabletask-dotnet.
FYI @jviau - would be good if you could take a look at this one
from durabletask-dotnet.
@jviau - Any update on this fix? this is a critical bug, and we are blocked on this for a very long time.
from durabletask-dotnet.
Related Issues (20)
- Support orchestration ID reuse policy
- ScheduleNewOrchestrationInstanceAsync() is Not Scheduling an Orchestration HOT 2
- Durable Task: Activity Exception thrown as an unhandled exception HOT 3
- Support Cascade Terminate/Purge
- Entities: Make `InitializeState` support Async operations HOT 4
- Unit Testing Isolated Model Azure Durable Function Orchestrator in .Net 8 HOT 6
- PurgeInstancesAsync fails after 100 seconds
- Class syntax example doesn't work HOT 2
- PurgeAllInstancesAsync Fails with Exception when there are no instances to Purge from PurgeFilter HOT 1
- Listing instances with DurableTaskClient.GetAllInstancesAsync() is more than twice as slower than with IDurableOrchestrationClient.ListInstancesAsync() HOT 4
- Durable functions hubname cannot be configured from app settings HOT 1
- WaitForExternalEvent<T>(eventName, timespan, cancellationToken) not supported (anymore?) in isolated mode
- Ability to Set Both RetryPolicy? Policy and AsyncRetryHandler? Handler in TaskRetryOptions HOT 8
- (De)serialize `State` property when using `TaskEntity<TState>`-based implementation not working (correctly) HOT 7
- DurableTaskClient.PurgeAllInstancesAsync: NotSupportedException and RpcException for .net 8 isolated HOT 11
- Roslyn Analyzer: System.TimeProvider
- Roslyn Analyzer: document how orchestrations are analyzed and the method probing is executed.
- The filter passed to _PurgeAllInstancesAsync(PurgeInstancesFilter filter, CancellationToken cancellation)_ on the DurableTaskClient, is not used, instead a new instance is created HOT 1
- Any documentation on how to build the project? HOT 1
- RaiseEventAsync with a given taskhubname is missing compared to in process HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from durabletask-dotnet.