Giter Site home page Giter Site logo

Comments (8)

TaoXieSZ avatar TaoXieSZ commented on July 24, 2024 1

Hi @s8sg.

Oh, I found the Register() is very similar to the Update() I just implemented, and I can revert that change to minimize PR.

However, the root cause I implement the update logic is that I found that there will be panic in this use case:

  1. At time $t_1$, UserA called Exec() to execute FlowA, the FlowA will end at $t_3$
  2. At time $t_2$ ($t_1 < t_2 < t_3 $), UserB called Register(FlowA, AnotherHandler)

The server process will have panic.

from goflow.

s8sg avatar s8sg commented on July 24, 2024

This should be already supported in GoFlow.

Register() should register the method to define the workflow. The method to define the dag executes when a request hits the go flow executor, but not at the start of the flow (at least this is what expected). This way you can dynamically change the definition of dag by changing/adding additional logic in your define workflow function

from goflow.

s8sg avatar s8sg commented on July 24, 2024

Yes. for any active request it will fail.

I think it's unavoidable. It should be taken care by the user to make sure there is no active requests

from goflow.

s8sg avatar s8sg commented on July 24, 2024

Even if we keep a snapshot of the dag definition per request and use the snapshot to execute the flow

Say a dag is D with node N1, N2, N3

Say for request R1 that comes at t1 we make D1 as the snapshot as if
D1 -> N1, N2, N3

A DAG can be changed to completely remove a node. Lets say that happens at t2
D -> N1, N2

In that case for the D1 snapshot is no longer valid, and when R1 tries to execute N3 at t3 it will not find the definition

(t1<t2<t3 )

from goflow.

s8sg avatar s8sg commented on July 24, 2024

Post completion #4, We should be able to do that without any concern, because workload will be completely independent of the DAG definition

Currently it's in progress. I'll suggest to wait until this feature is added

from goflow.

TaoXieSZ avatar TaoXieSZ commented on July 24, 2024

Even if we keep a snapshot of the dag definition per request and use the snapshot to execute the flow

Say a dag is D with node N1, N2, N3

Say for request R1 that comes at t1 we make D1 as the snapshot as if D1 -> N1, N2, N3

A DAG can be changed to completely remove a node. Lets say that happens at t2 D -> N1, N2

In that case for the D1 snapshot is no longer valid, and when R1 tries to execute N3 at t3 it will not find the definition

(t1<t2<t3 )

I think this is something like transaction concept in databases. This error is similar to read skew. I think in some cases, it is not acceptable if any running workflow is terminated accidentally by user's action. Of course, I didn't dive deep into theoretical background of workflow definition in this project.

Maybe it can be discussed further.

from goflow.

TaoXieSZ avatar TaoXieSZ commented on July 24, 2024

@s8sg Hi, is there any update about #4 ? That is so exciting to have a new version.

from goflow.

s8sg avatar s8sg commented on July 24, 2024

Still in progress. Didn’t got much time this weekend. Will try to finish it off my the next. Will require some help with the testing

from goflow.

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.