Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor retries #772

Closed
cdavernas opened this issue May 30, 2023 · 4 comments · Fixed by #820
Closed

Refactor retries #772

cdavernas opened this issue May 30, 2023 · 4 comments · Fixed by #820
Assignees
Labels
area: spec Changes in the Specification change: feature New feature or request. Impacts in a minor version change
Milestone

Comments

@cdavernas
Copy link
Member

What would you like to be added?

Refactor retries

Why is this needed?

Retries are one of the many actions that could be undertaken when an error is caught.

The current retry (strategy) definition should IMO be referenced by an handler that undertakes a retry upon given kinds of error (or upon all errors, possibly except some). It actually mixes both the handler and the retry concerns, and as such limit possibilities that we could open with my proposal.

What is your proposal?

Create a new errorHandler definition, that would allow users to define the errors they want to catch (or not to catch) and how they want to react (or not to react) to them.

An errorHandler could look like the following:

name: on-503
catch:
  when: 
    #type: https://fake.hotel.com/errors/bookings/failed
    status: 503
    # title: NotAvailable
    # condition: ${ jqexpression }
  #whenNot:
  #...
then:
  continue: true #continue the flow as if nothing happened
  #retry:
  #  policy: my-retry-policy
  # end: true
  # compensate: true

An action could then reference it like so:

actions:
  - name: my-action 
    functionRef: my-first-action
    onError:
      - on-503
@cdavernas cdavernas added change: feature New feature or request. Impacts in a minor version change area: spec Changes in the Specification labels May 30, 2023
@cdavernas cdavernas self-assigned this May 30, 2023
@ricardozanini ricardozanini moved this from Backlog to Todo in Progress Tracker May 30, 2023
@ricardozanini ricardozanini added this to the v0.9 milestone May 30, 2023
@ricardozanini
Copy link
Member

cc @fjtirado

@lsytj0413
Copy link
Contributor

It's seems like this is another style of error representation as which describe in #770 . Should we keep use an unified representation?

@cdavernas
Copy link
Member Author

cdavernas commented Jun 1, 2023

@lsytj0413 No, not really, though the two issues are undeniably linked.
#770 intends to refactor the way runtimes should represent an error, while this one is about how to handle (and what we can do with) it, when produced by either runtimes or some kind of throw mechanism like proposed in #771

I chose to split it in 2 different issues for the sake of simplicity and in order to avoid following God PRs.

Does that make sense to you?

@ricardozanini ricardozanini moved this from Todo to In Progress in Progress Tracker Feb 15, 2024
@cdavernas cdavernas mentioned this issue Feb 15, 2024
9 tasks
@cdavernas
Copy link
Member Author

cdavernas commented May 17, 2024

Closed as resolved by 1.0.0-alpha1, and therefore as part of #843

@github-project-automation github-project-automation bot moved this from In Progress to Done in Progress Tracker May 17, 2024
This was referenced May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: spec Changes in the Specification change: feature New feature or request. Impacts in a minor version change
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants