Skip to content

Refactor retries #772

Closed
Closed
@cdavernas

Description

@cdavernas
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

Activity

added
change: featureNew feature or request. Impacts in a minor version change
area: specChanges in the Specification
on May 30, 2023
self-assigned this
on May 30, 2023
moved this from Backlog to Todo in Progress Trackeron May 30, 2023
added this to the v0.9 milestone on May 30, 2023
ricardozanini

ricardozanini commented on May 30, 2023

@ricardozanini
Member
lsytj0413

lsytj0413 commented on Jun 1, 2023

@lsytj0413
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

cdavernas commented on Jun 1, 2023

@cdavernas
MemberAuthor

@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?

moved this from Todo to In Progress in Progress Trackeron Feb 15, 2024
cdavernas

cdavernas commented on May 17, 2024

@cdavernas
MemberAuthor

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

4 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: specChanges in the Specificationchange: featureNew feature or request. Impacts in a minor version change

Type

No type

Projects

Status

Done

Relationships

None yet

    Development

    Participants

    @ricardozanini@lsytj0413@cdavernas

    Issue actions

      Refactor retries · Issue #772 · serverlessworkflow/specification