cadence-client icon indicating copy to clipboard operation
cadence-client copied to clipboard

Defer cancel() causes non-determinstic error

Open longquanzheng opened this issue 6 years ago • 2 comments

WF(){
   ctx, cancel := workflow.WithCancel(ctx)
   defer cancel()
   scheduleActivities...
}

Looks like this would cause non-deterministic error when workflow is kicked out of cache(cancel() will be called) We need to write test to verify it and see if we can fix this issue.

longquanzheng avatar Nov 21 '19 01:11 longquanzheng

This doesn't make sense as no decision task should be running while workflow is kicked out of the cache. The only possibility is that there is a race condition between a decision task execution and cache eviction.

mfateev avatar Nov 21 '19 01:11 mfateev

there's a decent chance this was filed for the errors I'm seeing. if so: we've been investigating in a lot more detail, our defers don't seem related.

Groxx avatar Dec 02 '19 22:12 Groxx