Skip to content

feat(dns): retry requests on 408, 502, 503, 504 - #1854

Open
cgoetz-inovex wants to merge 2 commits into
mainfrom
feat/STACKITTPR-990-5xx-retries
Open

cgoetz-inovex wants to merge 2 commits into
mainfrom
feat/STACKITTPR-990-5xx-retries

Conversation

@cgoetz-inovex

Copy link
Copy Markdown
Contributor

Description

relates to #1234

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated (see e.g. here)
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@cgoetz-inovex
cgoetz-inovex requested a review from a team as a code owner October 23, 2026 14:21
}

func (f *DefaultClientFactory) defaultConfigOptions(customEndpoint string) []config.ConfigurationOption {
func (f *DefaultClientFactory) defaultConfigOptions(customEndpoint string, additionalRetryStatusCodes ...int) []config.ConfigurationOption {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Went for just status code varargs instead of function opts varargs, since this will probably become the default in 2 weeks

}
}

func TestRetryTransport_AdditionalStatusCodes_RetryAfter(t *testing.T) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Retry-After checked for all status codes. The standard only gives some examples:
https://httpwg.org/specs/rfc9110.html#field.retry-after

MaxRetries: defaultMaxRetries,
BaseBackoff: defaultBaseBackoff,
MaxJitter: defaultMaxJitter, // Always added to wait time
AdditionalRetryStatusCodes: additionalRetryStatusCodes,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we please have a note here that this is not intended for GA yet and only for selected services?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we also had it that way for the HTTP 429 retries back then.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added

http.StatusGatewayTimeout,
}

for _, statusCode := range statusCodes {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess it makes sense to have this as a table test which asserts that e.g. HTTP 200 status codes are not retried while the ones currently listed are.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

non-retries of other status codes is covered in TestDefaultClientFactory_RetryRequests. Since this state is rather short lived, I've opted to only test the additional behaviour here in separate tests.
When this retry behaviour gets applied to the default middlewares, we can delete the tests added in this PR and extend the ones for the default middleware stack.

Is this ok for you or should I replicate some test cases here?

This branch has not been deployed

No deployments
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