temporal icon indicating copy to clipboard operation
temporal copied to clipboard

Force to complete by id for an activity by default

Open alexseedkou opened this issue 1 year ago • 2 comments

What changed?

Per the discussion here, we want to introduce the feature to force to complete an activity for all RespondActivityTask*ById handlers.

  • Add a flag to check if the request is called by CompleteActivityById.
  • Add logic to fabricate a started event only when we want to force to complete an activity while the activity is backing off.
  • Add functional test to cover the chagne.

Why?

In async workflow, a bug or transit issue may cause an activity to fail. This will continuously fail a callback of some other process as the previous activity is backing off. With this change, we introduce a flag to let the server know we want to force the completion of the activity even if it is backing off in order to unblock the workflow.

Please refer to the issue for more discussions.

How did you test it?

Add a functional test for it.

Potential risks

When we fabricate a started event, it may raise a concurrency issue as the activity that is backing off may start right after the check to fabricate a started event. I did not find the potential risk here, but would like to make a callout to the team in case I miss anything.

Documentation

Is hotfix candidate?

alexseedkou avatar Apr 14 '24 01:04 alexseedkou

This is almost good to go AFAICT, I'm running the tests to confirm. Left a few small remaining comments.

bergundy avatar May 03 '24 13:05 bergundy

This is almost good to go AFAICT, I'm running the tests to confirm. Left a few small remaining comments.

I just made an update to address the lint.

Let me know if you have any comments after your review.

Thank you!

alexseedkou avatar May 03 '24 17:05 alexseedkou