REVERT_ALL strategy is not applied for all tasks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
taskflow |
In Progress
|
Undecided
|
Unassigned |
Bug Description
I'm investigating an issue in OpenStack Octavia and found some strange behavior in the taskflow engine.
And it seems that REVERT_ALL is not applied to all successfully completed tasks before.
The tasks hierarchy looks like:
Hierarchy:
"linear_
|_
|_
|_
| |__"subflow1_
| |__"subflow1-
Both StartTask and StartTask2 have a "revert" method, and subflow1/subflow2 are similar and look like this:
job_items = list(range(10))
class JobTask(task.Task):
def execute(self):
item = job_items.pop()
if item == 5:
raise Exception('JobTask: test error')
raise RetryException
class JobRetry(
def on_failure(self, history, *args, **kwargs):
last_errors = history[-1][1]
for task_name, ex_info in last_errors.
excp = ex_info.
if isinstance(excp, RetryException):
return retry.REVERT_ALL
I can see applying REVERT_ALL strategy in the logs, but neither the StartTask nor StartTask2 revert methods are called.
I have attached a simple script that demonstrates this behavior.
In Octavia I get that the LB creation is just stuck because the code is definitely expecting the entire flow to be reverted but it doesn't.
I'm not sure if this is a taskflow issue or the code can be workedaround somehow.
I may be can say that at least this behavior does not correlate with the docs that say
"This strategy will revert every atom that has executed thus far, regardless of whether the parent flow has a separate retry strategy associated with it"
Changed in taskflow: | |
status: | New → Confirmed |
Changed in taskflow: | |
status: | Confirmed → In Progress |
Hi Anton,
I was working on the same issue this week, I proposed a WIP patch with a reproducer in the test and a potential workaround in taskflow: https:/ /review. opendev. org/c/openstack /taskflow/ +/900746
Note there's a launchpad for octavia: https:/ /bugs.launchpad .net/octavia/ +bug/2043360
We may stop using the retries in Octavia as a workaround if we don't find a good fix in taskflow