--- kind: CONCEPT slug: adapter-outbound-httpclient-c04 title: 뒤 규칙이 앞 규칙의 금지를 되돌리지 못한다 topic: state-machines-and-ownership project: clean-architecture-backend-template status: 게시 전 sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916 rootTreeNode: concept:adapter-outbound-httpclient-c04 evidenceCapturedOn: 2026-09-01 assets: - key: adapter-outbound-httpclient-c04 file: ../../../final/evidence/rendered/adapter-outbound-httpclient-c04.svg - key: adapter-outbound-httpclient-c04-diagram file: ../../../final/assets/diagrams/adapter-outbound-httpclient-c04.svg evidence: - ../../../final/evidence/raw/adapter-outbound-httpclient-c04.txt source: - 원본 분석 절은 analysis/11-adapter-outbound-httpclient.md#L305 이다. module: adapter-outbound-httpclient --- # 뒤 규칙이 앞 규칙의 금지를 되돌리지 못한다 `DefaultRetryEligibilityEngine.decide`의 javadoc이 규칙이다 — 싼 절대 차단이 먼저 오고, 그다음 모호성, 그다음 상태·실패별 규칙이 온다. ## 본문 `DefaultRetryEligibilityEngine.decide`의 javadoc이 규칙이다 — "The order is the point. Cheap absolute blockers come first (attempts, budget, replayability, first byte, deadline, draining), then ambiguity, then status- and failure-specific rules. **A later rule can never re-enable something an earlier rule forbade.**" ## 재시도 결정의 순서 :::evidence key="adapter-outbound-httpclient-c04-diagram" alt="절대 차단 여섯과 영구 실패 범주와 증거와 상태별 규칙이 왼쪽에서 오른쪽으로 이어지는 구조" caption="재시도 결정의 순서" zoom="false" ::: 절대 차단 여섯이 먼저다 — 시도 수 소진 · 예산 소진 · 본문 재생 불가 · **첫 바이트 전달됨** · 런타임 draining · 남은 deadline이 최소 시도 예산 이하. 그다음 영구 실패 범주, 그다음 증거, 그다음 상태/실패별 규칙이다. ## DefaultRetryEligibilityEngine 참조 위치 :::evidence key="adapter-outbound-httpclient-c04" alt="코드베이스에서 DefaultRetryEligibilityEngine 를 검색한 출력 14줄. 이 기록이 세는 참조가 그 출력에 그대로 보인다." caption="DefaultRetryEligibilityEngine 코드베이스 검색 — 14줄 · exit 0" zoom="true" ::: ## HTTP 메서드가 결정에 들어 있지 않다 `RetryContext.safelyIdempotent()`가 이 모듈의 D-09를 구현한다 — HTTP 메서드는 `RetryContext`에 **아예 없다**("so a POST with a registered idempotency key and a GET against a non-idempotent RPC endpoint are both handled correctly instead of by method-name folklore"). 키 기반 멱등성은 **키가 실제로 전송됐는지**까지 요구한다. test `aKeyThatWasNeverSentDoesNotMakeARepeatSafe`가 그것을 고정한다. ## 존중한 Retry-After를 자르지 않는 이유 `Retry-After`는 남은 deadline 안에 들어갈 때만 존중된다(`allowWithin`), 그리고 존중된 `Retry-After`는 `maxBackoff`로 잘리지 **않는다** — 잘라 버리면 업스트림이 요청한 대기보다 일찍 다시 두드리게 되기 때문이다.