Files
document-haness/docs/clean-architecture-backend-template/tech-log-studio/state-ownership-and-concurrency/case/case-grpc-advanced-bootstrap-f03.md
T
DongHyeonkaandClaude Opus 5 b2963105a8 docs(keycloak-session-store): import the session-storage lab as a new project
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>
2026-09-04 22:51:59 +09:00

85 lines
3.6 KiB
Markdown

---
kind: CASE
slug: grpc-advanced-bootstrap-f03
title: 깃발 홀더가 가변이고 동기화가 없다
topic: state-ownership-and-concurrency
project: clean-architecture-backend-template
status: 게시 전
sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
rootTreeNode: case:grpc-advanced-bootstrap-f03
evidenceCapturedOn: 2026-09-01
assets:
- key: grpc-advanced-bootstrap-f03
file: ../../../final/evidence/rendered/grpc-advanced-bootstrap-f03.svg
evidence:
- ../../../final/evidence/raw/grpc-advanced-bootstrap-f03.txt
source:
- 원본 분석 절은 analysis/grpc/grpc-advanced-bootstrap.md#L209 이다.
module: grpc-advanced-bootstrap
priority: P3
---
# 깃발 홀더가 가변이고 동기화가 없다
GrpcAdvancedFeatureFlags 는 두 EnumMap 을 enable·withGrade 로 갱신하고, available·active 가 같은 맵을 읽는다. synchronized·volatile·동시 자료구조가 없다.
## 문제
GrpcAdvancedFeatureFlags 는 두 EnumMap 을 enable·withGrade 로 갱신하고, available·active 가 같은 맵을 읽는다.
synchronized·volatile·동시 자료구조가 없다.
## 결론
시작 시 전부 설정하고 그 뒤로 읽기만 한다면 안전 공개 문제만 남는다.
다만 두 메서드가 this 를 돌려주는 유창한 형태라 런타임 중 갱신을 권하는 모양이고, active() 는 순회 중 갱신에 노출된다.
같은 저장소가 이 형태를 다른 리프에서 결함으로 기록했다(GrpcCompletionReconciler 의 동기화 없는 ArrayList).
여기서는 등급과 깃발이 요청 경로에서 읽히므로 같은 노출이 생길 수 있다.
수정은 홀더를 불변으로 만들고 enable·withGrade 가 새 인스턴스를 돌려주게 하는 것이다.
이 저장소가 다른 곳에서 쓰는 형태다(GrpcProtoStyleManifest.allowingWellKnownTypes 등).
## 검증 환경
OpenJDK : 21.0.12 java -version 으로 확인
Gradle : 9.0.0 src/gradle/wrapper/gradle-wrapper.properties 의 distributionUrl 로 확인
확인 방식 : GrpcAdvancedFeatureFlags 참조 7건 검색과 두 EnumMap 의 갱신·읽기 지점 동기화 마커 확인
소스 수정 : x
## 재현 조건
원문은 analysis/grpc/grpc-advanced-bootstrap.md#L209 에 있다.
## 본문
<!-- body:start -->
`GrpcAdvancedFeatureFlags` 는 두 `EnumMap``enable`·`withGrade` 로 갱신하고, `available`·`active` 가 같은 맵을 읽는다. `synchronized`·`volatile`·동시 자료구조가 없다.
## GrpcAdvancedFeatureFlags 참조 위치
:::evidence key="grpc-advanced-bootstrap-f03" alt="코드베이스에서 GrpcAdvancedFeatureFlags 를 검색한 출력 7줄. 이 기록이 세는 참조가 그 출력에 그대로 보인다." caption="GrpcAdvancedFeatureFlags 코드베이스 검색 — 7줄 · exit 0" zoom="true"
:::
## 시작 시 전부 설정한다면 안전 공개 문제만 남는다
다만 두 메서드가 `this` 를 돌려주는 유창한 형태라 런타임 중 갱신을 권하는 모양이고, `active()` 는 순회 중 갱신에 노출된다.
## 같은 저장소가 이 형태를 다른 리프에서 결함으로 기록했다
`GrpcCompletionReconciler` 의 동기화 없는 `ArrayList` 다. 여기서는 등급과 깃발이 요청 경로에서 읽히므로 같은 노출이 생길 수 있다.
## 수정
홀더를 불변으로 만들고 `enable`·`withGrade` 가 새 인스턴스를 돌려주게 하는 것이다. 이 저장소가 다른 곳에서 쓰는 형태다(`GrpcProtoStyleManifest.allowingWellKnownTypes` 등).
## 확인하지 못한 것
동시 갱신과 읽기를 실행으로 재현하지 않았다. 동기화 장치가 없다는 코드 형태로 판정했다.
<!-- body:end -->