From e2765f764dda6e17ecdc0e954f94ce4366295b88 Mon Sep 17 00:00:00 2001 From: Petri Kivikangas Date: Thu, 11 Oct 2018 11:09:58 +0900 Subject: [PATCH 1/2] Exponential backoff proposal --- middleware/RetryHandler.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/middleware/RetryHandler.md b/middleware/RetryHandler.md index e53ff30..0c8bdd0 100644 --- a/middleware/RetryHandler.md +++ b/middleware/RetryHandler.md @@ -9,9 +9,16 @@ Provide a reusuable component that provides application developers with effectiv - Retried Requests should be equivalent to the initial request made. - A `retry-attempt` header SHOULD be added which contains a numeric value representing the retry number. This value will be used for diagnostics and determining the effectiveness of the retry handler. - Retries MUST respect the `retry-after` response header if provided. -- Where no `retry-after` header is provided by the server, an exponential backoff with random offset hueristic should be used to determine the retry delay. -- Retries should be limited to a maximum value. -- Only requests with payloads that are buffered/rewindable are supported. Payloads with forward only streams will be have the responses returned without any retry attempt. +- Retries should be limited by maximum elapsed time and maximum retry attempts +- Where no `retry-after` header is provided by the server, perform retry with the retry handler specified by the library consumer, or fall back to the default handler implemented as exponential backoff handler. +- Allow library consumer to set the parameters for the exponential backoff, and also provide sane defaults, e.g.: + - initial retry interval: 0.5 seconds + - retry interval randomization factor: 0.5 + - retry interval multiplier: 1.5 + - maximum interval: 1 minute + - maximum elapsed time: 10 minutes + - maximum retry attempts: 50 +- Only requests with payloads that are buffered/rewindable are supported. Payloads with forward only streams will be have the responses returned without any retry attempt. ### Supported Status Codes From df805b2104054a97f20bf958dc4eb105ccefa052 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 1 Aug 2024 14:18:55 -0400 Subject: [PATCH 2/2] fix; documents latest defaults for retry policy Signed-off-by: Vincent Biret --- middleware/RetryHandler.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/middleware/RetryHandler.md b/middleware/RetryHandler.md index 0c8bdd0..d47aeeb 100644 --- a/middleware/RetryHandler.md +++ b/middleware/RetryHandler.md @@ -12,12 +12,11 @@ Provide a reusuable component that provides application developers with effectiv - Retries should be limited by maximum elapsed time and maximum retry attempts - Where no `retry-after` header is provided by the server, perform retry with the retry handler specified by the library consumer, or fall back to the default handler implemented as exponential backoff handler. - Allow library consumer to set the parameters for the exponential backoff, and also provide sane defaults, e.g.: - - initial retry interval: 0.5 seconds - - retry interval randomization factor: 0.5 - - retry interval multiplier: 1.5 - - maximum interval: 1 minute - - maximum elapsed time: 10 minutes - - maximum retry attempts: 50 + - initial retry interval: 3 seconds + - retry interval multiplier: (retry number)^2 + - maximum interval: 180 seconds + - maximum elapsed time: 1800 seconds (10 retries ^ 2 * 180 seconds) + - maximum retry attempts: 10 - Only requests with payloads that are buffered/rewindable are supported. Payloads with forward only streams will be have the responses returned without any retry attempt. ### Supported Status Codes