GithubHelp home page GithubHelp logo

Comments (7)

davidmrdavid avatar davidmrdavid commented on June 4, 2024

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.

sagimar avatar sagimar commented on June 4, 2024

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:

  1. Fetched instance status - RuntimeStatus: NotFound
  2. Sending [ExecutionStarted] message, SequenceNumber: 1
  3. Updated instances table and set the runtime status to 'Pending'
  4. Fetched instance status - RuntimeStatus: Pending
  5. Sending [ExecutionStarted] message, SequenceNumber: 2
  6. 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.

davidmrdavid avatar davidmrdavid commented on June 4, 2024

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.

sagimar avatar sagimar commented on June 4, 2024

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.

violetVo avatar violetVo commented on June 4, 2024

@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.

davidmrdavid avatar davidmrdavid commented on June 4, 2024

FYI @jviau - would be good if you could take a look at this one

from durabletask-dotnet.

violetVo avatar violetVo commented on June 4, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.