Closed kl52752 closed 5 months ago
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: kl52752 Once this PR has been reviewed and has the lgtm label, please assign bowei for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
/cc @mag-kol /cc @AwesomePatrol /cc @akwi-github
Why not create a new Executor to continue execution? It makes the contract and lifecycle of the object more complex to be able to call into the object multiple times after a "done" state.
Why not create a new Executor to continue execution? It makes the contract and lifecycle of the object more complex to be able to call into the object multiple times after a "done" state.
Everything depends on the retry strategy. Please take a look at the doc.
If we will implement retries inside the executor using provided by clients function then the approach of creating the executor per run is ok. Error strategy is not enough in this case because we do not retry failed operation, we can ignore errors only.
If we will not do the retries in the executor then IMO it is better to add ability to the clients to retry the operation on the same executor if needed.
I don't quite understand your comment. To rerun Action
s, you need to reset the state of the Action, as internally it has a PendingEvents
list that will not be in the right state after running the executor.
If it's the case that you want to redo what remains, you can run a new Executor with the list of actions from append(result.Errors, result.Pending...)
to re-run what was either in error or still pending.
I don't see why we need to make it possible to rerun Run()
, this can introduce complexity in handling of state between runs.
Discussed offline that this refactor is not needed
Change Executor
Run
function to accept as an input list of pending actions. This way we can implement retires and run Executor multiple times with different set of actions.Change SerialExecutor constructor to accept cloud client as an input.