Retry Policy and Exponential Backoff
再試行ポリシーと指数バックオフ
リトライポリシーは、どの失敗したジョブが再試行できるかを決定します。バックオフは、各失敗後により長い待機時間を追加します。
もう一つの例
サービスが503エラーを受け取ります。2回目の試行まで約1秒、3回目の試行まで約2秒待ちます。3回目の試行で成功します。
主な部分
- 01再試行可能なエラー
- 02試行番号
- 03成長の遅延
- 04ジッター
- 05予算停止
以下の場合に使用します
作業を繰り返すことが安全である場合の短いネットワークまたはサービスの障害に使用します。
以下の場合は使用しないでください
悪い入力やアクセス拒否を再試行しないでください。支払いの場合、同じ請求が二重に行われないようにするキーを最初に使用してください。
コードで使用する名前
retryable error + delay * 2 + jitter + attempt budget 出荷前に
Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback.
Outcome:Complete the task with 再試行ポリシーと指数バックオフ (Retry Policy and Exponential Backoff)。 User context:サービスが503エラーを受け取ります。2回目の試行まで約1秒、3回目の試行まで約2秒待ちます。3回目の試行で成功します。 Technical concept or control:再試行ポリシーと指数バックオフ (Retry Policy and Exponential Backoff)。 Why it fits:作業を繰り返すことが安全である場合の短いネットワークまたはサービスの障害に使用します。 Do not use it when:悪い入力やアクセス拒否を再試行しないでください。支払いの場合、同じ請求が二重に行われないようにするキーを最初に使用してください。 Engineering requirements: Define inputs, outputs, contracts, and rules that must always hold. Set authorization and input checks. Define failures, timeouts, retries, one-time effects, data moves, and compatibility limits. Operations: Add useful signals and logs that hide sensitive data. Set capacity limits and write an operator guide. Test recovery and rollback. Acceptance criteria: Contract and failure-path tests pass. Data and authorization rules still hold during retries and partial failures. Check performance limits, monitoring, recovery, and rollback. Evidence and limits (evidence boundary):単一の公式標準が全体の用語を管理するわけではありません。その意味はチーム、プラットフォーム、またはフレームワークによって変わる可能性があります。 Unknowns to confirm: Where the code runs, data stores, traffic shape, consistency needs, and the security boundary. Also confirm the compatibility period, service goals, and rollback limits.
このリクエストを確認する
Review how 再試行ポリシーと指数バックオフ (Retry Policy and Exponential Backoff) is used now. Definition: リトライポリシーは、どの失敗したジョブが再試行できるかを決定します。バックオフは、各失敗後により長い待機時間を追加します。 Release checks: Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.