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>
78 lines
3.3 KiB
Markdown
78 lines
3.3 KiB
Markdown
---
|
|
kind: CASE
|
|
slug: grpc-policy-f04
|
|
title: 완료 조정자가 요청 경로에서 동기화 없는 가변 리스트를 변경한다
|
|
topic: state-ownership-and-concurrency
|
|
project: clean-architecture-backend-template
|
|
status: 게시 전
|
|
sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
|
|
rootTreeNode: case:grpc-policy-f04
|
|
evidenceCapturedOn: 2026-09-01
|
|
assets:
|
|
- key: grpc-policy-f04
|
|
file: ../../../final/evidence/rendered/grpc-policy-f04.svg
|
|
- key: grpc-policy-f04-diagram
|
|
file: ../../../final/assets/diagrams/grpc-policy-f04.svg
|
|
evidence:
|
|
- ../../../final/evidence/raw/grpc-policy-f04.txt
|
|
source:
|
|
- 원본 분석 절은 analysis/grpc/grpc-policy.md#L271 이다.
|
|
module: grpc-policy
|
|
priority: P2
|
|
---
|
|
|
|
# 완료 조정자가 요청 경로에서 동기화 없는 가변 리스트를 변경한다
|
|
|
|
synchronized·Concurrent*·volatile·Lock 전부 0 이고 단일 스레드 전용 표기도 없다. 같은 리프의 GrpcSerializedStreamWriter 는 아홉 마커로 제대로 닫혀 있어, 이 리프가 동시성을 인지하고 있음을 보여 준다.
|
|
|
|
## 문제
|
|
|
|
synchronized·Concurrent*·volatile·Lock 전부 0 이고 단일 스레드 전용 표기도 없다.
|
|
|
|
같은 리프의 GrpcSerializedStreamWriter 는 아홉 마커로 제대로 닫혀 있어, 이 리프가 동시성을 인지하고 있음을 보여 준다.
|
|
|
|
## 결론
|
|
|
|
reconcile 은 완료 결과가 불확실한 호출마다 불린다 — 장애 상황에서 동시에 몰리는 경로다.
|
|
|
|
그리고 pending 이 담는 것은 사람이 조정해야 하는 연산 목록이므로, 유실은 조정되지 않은 채 잊히는 연산이 된다.
|
|
|
|
## 검증 환경
|
|
|
|
OpenJDK : 21.0.12 java -version 으로 확인
|
|
Gradle : 9.0.0 src/gradle/wrapper/gradle-wrapper.properties 의 distributionUrl 로 확인
|
|
확인 방식 : GrpcSerializedStreamWriter 참조 11건 검색과 조정자 쪽 동기화 마커 유무 대조
|
|
소스 수정 : x
|
|
|
|
## 재현 조건
|
|
|
|
원문은 analysis/grpc/grpc-policy.md#L271 에 있다.
|
|
|
|
## 본문
|
|
|
|
<!-- body:start -->
|
|
|
|
`synchronized`·`Concurrent*`·`volatile`·`Lock` 전부 0 이고 단일 스레드 전용 표기도 없다.
|
|
|
|
## 동기화가 걸린 곳과 아닌 곳
|
|
|
|
:::evidence key="grpc-policy-f04-diagram" alt="GrpcSerializedStreamWriter 만 동기화 마커 안에 놓이고 완료 조정자의 pending 이 바깥에 빗금으로 놓인다" caption="동기화가 걸린 곳과 아닌 곳" zoom="false"
|
|
:::
|
|
|
|
같은 리프의 `GrpcSerializedStreamWriter` 는 아홉 마커로 제대로 닫혀 있어, 이 리프가 동시성을 인지하고 있음을 보여 준다.
|
|
|
|
## GrpcSerializedStreamWriter 참조 위치
|
|
|
|
:::evidence key="grpc-policy-f04" alt="코드베이스에서 GrpcSerializedStreamWriter 를 검색한 출력 11줄. 이 기록이 세는 참조가 그 출력에 그대로 보인다." caption="GrpcSerializedStreamWriter 코드베이스 검색 — 11줄 · exit 0" zoom="true"
|
|
:::
|
|
|
|
## 하필 장애 상황에 몰리는 경로다
|
|
|
|
`reconcile` 은 완료 결과가 불확실한 호출마다 불린다. 그리고 `pending` 이 담는 것은 사람이 조정해야 하는 연산 목록이므로, 유실은 조정되지 않은 채 잊히는 연산이 된다.
|
|
|
|
## 확인하지 못한 것
|
|
|
|
요청 경로에서 동시 변경을 재현하지 않았다. 동기화 마커가 0 이고 단일 스레드 전용 표기도 없다는 것으로 판정했다.
|
|
|
|
<!-- body:end -->
|