Skip to content

feat: add temporary field to default error#103

Closed
zepatrik wants to merge 1 commit intomasterfrom
feat/error-retryability
Closed

feat: add temporary field to default error#103
zepatrik wants to merge 1 commit intomasterfrom
feat/error-retryability

Conversation

@zepatrik
Copy link
Member

@zepatrik zepatrik commented Dec 7, 2021

Related Issue or Design Document

This feature allows to easily tell the client which errors it should retry and which need intervention.

Checklist

  • I have read the contributing guidelines
    and signed the CLA.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got green light (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added necessary documentation within the code base (if
    appropriate).

Further comments

// retried by the client after a reasonable backoff.
//
// required: true
TemporaryField bool `json:"temporary"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd inverse this and say "no_retry" because this error might not even make it to the caller if something else fails (e.g. internal cluster network error).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No retry feels very weird, as you have to say NoRetry = false to specify it is retryable. But you want the default to be retry right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, default should be retry for most 5xx errors (e.g. 502 bad gateway) and and some 4xx errors (e.g. 429 too many requests).

Usually, one would use the Retry-After to indicate when the retry can happen again. However, most of the infrastructure currently doesn't support setting this value correctly.

To disable retry explicitly, one could set Retry-After to a date far in the future, for example.

In summary, I don't think setting this as a JSON key is an appropriate fix as it is very application specific. We should probably work with default HTTP headers that are understood by most clients already.

For the console, we can narrow down the codes that need retry, e.g. 429, 503, 502, 500

@zepatrik
Copy link
Member Author

zepatrik commented Dec 7, 2021

OK, closing as this fix is too specific.

@zepatrik zepatrik closed this Dec 7, 2021
@zepatrik zepatrik deleted the feat/error-retryability branch December 7, 2021 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants