The keycloak project ended with four open questions that design could not
settle. A two-VM lab was built to answer them by measurement, and this is
that material: 26 experiments, 125 raw command outputs, 22 browser captures.
Follows the import procedure in README.md.
source/ the originating repository verbatim — 78 documents, 28 SVGs,
8 manifests, plus .source-revision recording the commit
final/ the SSOT
document.md 729 lines written from the 29 experiment documents, not
concatenated: what was predicted, what was measured, and
where the measurement itself was wrong
evidence/raw 125 outputs, flattened to <experiment>__<file> because
the originals collided (01-baseline.txt appeared three
times) and the audit only globs the top level
evidence/meta one per raw file; command and exitCode are null and the
README says why rather than inventing them
evidence/browser 22 captures
assets/ three diagrams through techviz
.techviz/ their VizSpecs
A separate project rather than an addition to keycloak: the B-layer answers
that project's four questions, but the A, C and D layers are about cluster
failure, SSO and operations, and one document.md should hold one subject.
The four question records there can point here through 관계.
Recorded rather than papered over: only three of the 28 diagrams were
remade. The repository forbids hand-drawn SVG and forbids titles inside the
canvas; all 28 originals carry both, so converting them is redrawing, not
reformatting. They stay in source/ and the gap is written into the document.
verify-pipeline.py passes. audit-records.py reports no issues.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
45 lines
2.2 KiB
Markdown
45 lines
2.2 KiB
Markdown
---
|
|
kind: CONCEPT
|
|
slug: adapter-outbound-httpclient-c02
|
|
title: 회전이 틈으로 관측되지 않게 만든 순서와 두 누수 이력
|
|
topic: state-machines-and-ownership
|
|
project: clean-architecture-backend-template
|
|
status: 게시 전
|
|
sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
|
|
rootTreeNode: concept:adapter-outbound-httpclient-c02
|
|
evidenceCapturedOn: 2026-09-01
|
|
assets:
|
|
- key: adapter-outbound-httpclient-c02
|
|
file: ../../../final/evidence/rendered/adapter-outbound-httpclient-c02.svg
|
|
evidence:
|
|
- ../../../final/evidence/raw/adapter-outbound-httpclient-c02.txt
|
|
source:
|
|
- 원본 분석 절은 analysis/11-adapter-outbound-httpclient.md#L112 이다.
|
|
module: adapter-outbound-httpclient
|
|
---
|
|
|
|
# 회전이 틈으로 관측되지 않게 만든 순서와 두 누수 이력
|
|
|
|
`ClientRuntimeRegistry`는 교체본을 먼저 발행하고 이전 세대를 나중에 드레인한다. 과거 누수 두 건이 코드와 주석에 남아 있다.
|
|
|
|
## 본문
|
|
|
|
<!-- body:start -->
|
|
|
|
"A swap publishes the replacement first and drains the predecessor afterwards, so a rotation is never observable as a gap." `acquire`는 관측한 세대가 예약 직전에 draining으로 넘어가면 **새로 발행된 세대에 대해 재시도**한다.
|
|
|
|
## ClientRuntimeRegistry 참조 위치
|
|
|
|
:::evidence key="adapter-outbound-httpclient-c02" alt="코드베이스에서 ClientRuntimeRegistry 를 검색한 출력 24줄. 이 기록이 세는 참조가 그 출력에 그대로 보인다." caption="ClientRuntimeRegistry 코드베이스 검색 — 24줄 · exit 0" zoom="true"
|
|
:::
|
|
|
|
## 아무도 열거하지 않아서 보이지 않던 누수
|
|
|
|
교체된 세대가 `runtimes`에서 빠지고 스케줄된 drain 작업만 소유하게 되어, 그 작업이 발화하기 전에 레지스트리가 닫히면 "leaked the whole generation — and the resource-bound suite could not see it, because nothing enumerated it." 지금은 `retired` 집합이 추적한다.
|
|
|
|
## 실패가 클수록 더 많이 새던 종료
|
|
|
|
`close()`가 `forEach`로 닫다가 첫 예외에서 멈춰 "a single misbehaving pool left every remaining connection, thread and socket open — **shutdown leaked more the worse the failure was.**" 지금은 전부 닫고 실패를 suppressed로 모은다.
|
|
|
|
<!-- body:end -->
|