Circuit Breaker
サーキットブレーカー
サーキットブレーカーは、失敗する可能性が高いリモートサービスへの呼び出しを停止します。その後、いくつかのテスト呼び出しで回復したかを確認します。
closed -> failure threshold -> open -> cool-down -> half-open probe -> closed | open10秒リモート呼び出しなしclosed -> failure threshold -> open -> cool-down -> half-open probe -> closed | openSREもう一つの例
5回の支払い失敗でブレーカーが30秒間開きます。チェックアウトは、明確なメッセージで迅速に失敗します。後で行う1回のプローブは成功し、それを閉じます。
主な部分
- 01閉じた状態
- 02失敗カウンターとウィンドウ
- 03開始状態
- 04クールダウン時間
- 05半開プローブ
- 06フォールバックとアラート
以下の場合に使用します
遅いまたは壊れているままのリモート依存関係の周りで使用してください。しきい値、開放時間、テストトラフィック、フォールバック、アラートを調整します。
以下の場合は使用しないでください
ローカルのバリデーションエラーには使用しないでください。それはリトライの代わりにはなりません。リトライは短時間の障害を処理します; ブレーカーは発生しそうな失敗をブロックします。
コードで使用する名前
closed -> failure threshold -> open -> cool-down -> half-open probe -> closed | open 出荷前に
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 サーキットブレーカー (Circuit Breaker)。 User context:5回の支払い失敗でブレーカーが30秒間開きます。チェックアウトは、明確なメッセージで迅速に失敗します。後で行う1回のプローブは成功し、それを閉じます。 Technical concept or control:サーキットブレーカー (Circuit Breaker)。 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 サーキットブレーカー (Circuit Breaker) 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.