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>
98 lines
4.7 KiB
Markdown
98 lines
4.7 KiB
Markdown
---
|
|
kind: CASE
|
|
slug: grpc-discovery-f03
|
|
title: 목록으로 보고하는 검증기가 주소 수 0 에서 던진다
|
|
topic: state-ownership-and-concurrency
|
|
project: clean-architecture-backend-template
|
|
status: 게시 전
|
|
sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
|
|
rootTreeNode: case:grpc-discovery-f03
|
|
evidenceCapturedOn: 2026-09-01
|
|
assets:
|
|
- key: grpc-discovery-f03
|
|
file: ../../../final/evidence/rendered/grpc-discovery-f03.svg
|
|
evidence:
|
|
- ../../../final/evidence/raw/grpc-discovery-f03.txt
|
|
source:
|
|
- 원본 분석 절은 analysis/grpc/grpc-discovery.md#L187 이다.
|
|
module: grpc-discovery
|
|
priority: P3
|
|
---
|
|
|
|
# 목록으로 보고하는 검증기가 주소 수 0 에서 던진다
|
|
|
|
profile.resolverProfile(n) 이 new GrpcResolverProfile(DNS, …, n) 을 만들고, 그 정규 생성자가 거부한다. 그래서 violations(profile, 0) 은 빈 목록도 위반 목록도 아닌 IllegalArgumentException 이다.
|
|
|
|
## 문제
|
|
|
|
profile.resolverProfile(n) 이 new GrpcResolverProfile(DNS, …, n) 을 만들고, 그 정규 생성자가 거부한다.
|
|
|
|
그래서 violations(profile, 0) 은 빈 목록도 위반 목록도 아닌 IllegalArgumentException 이다.
|
|
|
|
## 결론
|
|
|
|
같은 메서드가 profile == null 에는 명시적으로 던지고 나머지는 목록으로 답하므로, 호출자는 이 API 를 "던지지 않고 보고한다" 로 읽는다.
|
|
|
|
expectedAddressCount 는 이 리프가 계산하지 않고 입력으로 받는 값이고(§16), 그 출처는 헤드리스 레코드의 DNS 조회 결과다.
|
|
|
|
롤아웃 중 파드가 모두 교체되는 순간이나 셀렉터가 어긋난 서비스에서 그 답은 0 이다.
|
|
|
|
그것은 이 리프가 다루는 문제 영역 안의 상태이지 프로그래밍 오류가 아니다 — 그리고 운영자가 가장 보고받고 싶어 할 상태다.
|
|
|
|
GrpcResolverProfile 쪽 거부 자체는 옳다.
|
|
|
|
값 객체가 "주소 0 개인 목표"를 표현하지 않는 것은 §4 의 두 겹 분담과 일치한다.
|
|
|
|
어긋난 것은 그 위에 얹힌 검증기가 그 예외를 그대로 통과시킨다는 점이다.
|
|
|
|
violations 가 expectedAddressCount < 1 을 먼저 보고 위반 문자열로 보고한 뒤 나머지 검사를 건너뛴다.
|
|
|
|
## 검증 환경
|
|
|
|
OpenJDK : 21.0.12 java -version 으로 확인
|
|
Gradle : 9.0.0 src/gradle/wrapper/gradle-wrapper.properties 의 distributionUrl 로 확인
|
|
확인 방식 : resolverProfile(n) 이 부르는 정규 생성자의 거부 조건 경로 추적
|
|
소스 수정 : x
|
|
|
|
## 재현 조건
|
|
|
|
원문은 analysis/grpc/grpc-discovery.md#L187 에 있다.
|
|
|
|
## 본문
|
|
|
|
<!-- body:start -->
|
|
|
|
검증기는 목록으로 보고하는 형태다.
|
|
|
|
```java
|
|
public static List<String> violations(GrpcKubernetesProfile profile, int expectedAddressCount) {
|
|
…
|
|
List<String> violations = new ArrayList<>(
|
|
GrpcDiscoveryPolicyValidator.violations(profile.resolverProfile(expectedAddressCount)));
|
|
```
|
|
|
|
`profile.resolverProfile(n)` 이 `new GrpcResolverProfile(DNS, …, n)` 을 만들고, 그 정규 생성자가 `expectedAddressCount < 1` 을 거부한다. 그래서 `violations(profile, 0)` 은 빈 목록도 위반 목록도 아닌 `IllegalArgumentException` 이다.
|
|
|
|
## 목록으로 보고하는 형태
|
|
|
|
:::evidence key="grpc-discovery-f03" alt="분석 문서 analysis/grpc/grpc-discovery.md 에서 이 기록의 근거 절을 그대로 잘라낸 15줄. 코드베이스를 측정한 것이 아니라 원본 판정이 무엇을 적었는지를 보여 준다." caption="analysis/grpc/grpc-discovery.md 발췌 — 15줄" zoom="true"
|
|
:::
|
|
|
|
## 호출자는 이 API 를 던지지 않는 것으로 읽는다
|
|
|
|
같은 메서드가 `profile == null` 에는 명시적으로 던지고 나머지는 목록으로 답한다.
|
|
|
|
## 왜 0 이 실제 값인가
|
|
|
|
`expectedAddressCount` 는 이 리프가 계산하지 않고 입력으로 받는 값이고(§16), 그 출처는 헤드리스 레코드의 DNS 조회 결과다. 롤아웃 중 파드가 모두 교체되는 순간이나 셀렉터가 어긋난 서비스에서 그 답은 0 이다 — 이 리프가 다루는 문제 영역 안의 상태이지 프로그래밍 오류가 아니고, 운영자가 가장 보고받고 싶어 할 상태다.
|
|
|
|
## 값 객체 쪽 거부 자체는 옳다
|
|
|
|
값 객체가 "주소 0 개인 목표"를 표현하지 않는 것은 §4 의 두 겹 분담과 일치한다. 어긋난 것은 그 위에 얹힌 검증기가 그 예외를 그대로 통과시킨다는 점이다. `violations` 가 `expectedAddressCount < 1` 을 먼저 보고 위반 문자열로 보고한 뒤 나머지 검사를 건너뛰면 된다.
|
|
|
|
## 확인하지 못한 것
|
|
|
|
violations(profile, 0) 을 실행으로 재현하지 않았다. resolverProfile → GrpcResolverProfile 정규 생성자 경로로 판정했다.
|
|
|
|
<!-- body:end -->
|