s8sg / goflow

A Golang based high performance, scalable and distributed workflow framework
MIT License
1.06k stars 129 forks source link

stop state forward when pipeline is not active #70

Closed dan2li closed 11 months ago

dan2li commented 11 months ago

If pipeline is not active, don't enqueue requests of the next nodes and forward the state.

Code Change: Before executing any other logic in handleNextNodes, check if the pipeline is active. If it is not, simply return.

s8sg commented 11 months ago

I think this will cause error at https://github.com/s8sg/goflow/blob/7d15cb086eca3560dfea70922c10af2b230e7c85/core/sdk/executor/executor.go#L1353C2-L1353C21

I think instead of performing cleanup we can directly return and let the above line take care. WDYT ?

danl5 commented 11 months ago

Sure thing! I've added a commit and removed the cleanup operation. By the way, just wanted to mention that in my testing, I didn't encounter the error you mentioned above. 😉

s8sg commented 11 months ago

@danl5 Interesting. Wonder why ?

dan2li commented 11 months ago

Could it be that the pipeline was terminated prematurely because the stop operation, and did not follow the standard procedure of setting finished to true?