review-followup Wave 2: 정합성 수정 통합과 검증, 현황표·재개 프롬프트

13개 작업 묶음(P1–P13)의 W2 커밋을 합치고 전체 게이트로 검증했다.

- 묶음별 정합성 수정(notification dispatch·recovery, object storage staged
  publication, fileserver 복구·정리, gRPC 플랫폼, Redis 분류·lease TTL, JPA
  outbox claim 순서·durable operation HTTP, web 요청 id·category 필수, graphql
  에러 mapper, Mongo profile 바인딩, build 소스 보존 게이트·compose smoke info 확인)
- 통합 때 드러난 3건 수정: outbox claim 테스트 fixture의 가짜 envelope hash,
  sample scan이 새 operation controller를 등록하던 문제, SpotBugs aux classpath
  파일이 truncate되지 않아 로컬에서 ".jar.jar"로 실패하던 문제
- 현황표: 묶음 결과 반영, 소유자 결정 21–27, 후속 발견 결함 47행, 요약 갱신
- docs/capability-status.md 「제거된 코드」에 85행 추가
- 묶음 결과 파일·에이전트 지시·스크립트를 docs로 옮기고 desktop 재개 프롬프트 추가

검증: check, ci verifyDependencyLocks, mainCheck, architecture/public path/env
keys/config contract, bootstrap·sample integration/system, build-logic·build-tools
test, optional-platforms ci, qualificationBootJar 통과. integrationCheck는 이번
작업 전에도 실패하던 lane(Redis topology 모드 인자, httpclient failure
injection, AWS 보호 lane)만 실패.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
DongHyeonka
2026-09-28 14:46:30 +09:00
co-authored by Claude Opus 5.5
parent 2c7d1d58f3
commit 2c612cb95b
28 changed files with 763 additions and 134 deletions
@@ -3,7 +3,9 @@ package dev.caskeleton.grpc.client;
import dev.caskeleton.grpc.core.GrpcChannelProfileName;
import java.time.Instant;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -24,8 +26,9 @@ public final class GrpcChannelRuntimeRegistry {
private final ConcurrentMap<GrpcChannelProfileName, AtomicReference<GrpcChannelRuntime>> current =
new ConcurrentHashMap<>();
private final ConcurrentMap<GrpcChannelProfileName, List<GrpcChannelRuntime>> draining =
new ConcurrentHashMap<>();
// Guarded by this registry's lock, like every swap: rotations are rare, and one lock keeps the
// current pointer and the draining list from disagreeing.
private final Map<GrpcChannelProfileName, List<GrpcChannelRuntime>> draining = new HashMap<>();
private final GrpcChannelDrainPolicy drainPolicy;
/** Binds a registry to the drain policy its swaps use. */
@@ -37,7 +40,7 @@ public final class GrpcChannelRuntimeRegistry {
}
/** Installs the first generation for a profile. */
public GrpcChannelRuntime install(GrpcChannelGeneration generation) {
public synchronized GrpcChannelRuntime install(GrpcChannelGeneration generation) {
if (generation == null) {
throw new IllegalArgumentException("a generation is required");
}
@@ -80,7 +83,7 @@ public final class GrpcChannelRuntimeRegistry {
*
* @throws IllegalArgumentException when {@code next} does not supersede what is installed
*/
public GrpcChannelRuntime rotate(GrpcChannelGeneration next, Instant now) {
public synchronized GrpcChannelRuntime rotate(GrpcChannelGeneration next, Instant now) {
if (next == null || now == null) {
throw new IllegalArgumentException("a rotation needs a generation and a moment");
}
@@ -102,15 +105,12 @@ public final class GrpcChannelRuntimeRegistry {
GrpcChannelRuntime replacement = new GrpcChannelRuntime(next);
holder.set(replacement);
previous.beginDrain();
draining
.computeIfAbsent(
next.profileName(), key -> java.util.Collections.synchronizedList(new ArrayList<>()))
.add(previous);
draining.computeIfAbsent(next.profileName(), key -> new ArrayList<>()).add(previous);
return replacement;
}
/** The generations still draining for a profile. */
public List<GrpcChannelRuntime> draining(GrpcChannelProfileName profileName) {
public synchronized List<GrpcChannelRuntime> draining(GrpcChannelProfileName profileName) {
return List.copyOf(draining.getOrDefault(profileName, List.of()));
}
@@ -119,7 +119,7 @@ public final class GrpcChannelRuntimeRegistry {
*
* @return how many were retired
*/
public int retireQuiescent(GrpcChannelProfileName profileName) {
public synchronized int retireQuiescent(GrpcChannelProfileName profileName) {
List<GrpcChannelRuntime> runtimes = draining.get(profileName);
if (runtimes == null) {
return 0;
@@ -6,6 +6,12 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
import dev.caskeleton.grpc.core.GrpcChannelProfileName;
import java.time.Duration;
import java.time.Instant;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
@@ -125,4 +131,52 @@ class GrpcChannelRuntimeRegistryTest {
.extracting(Class::getName)
.noneMatch(name -> name.startsWith("io.grpc."));
}
@Test
void racingRotationsDrainEveryReplacedRuntimeAndKeepTheNewestCurrent() throws Exception {
// when
Set<String> outcomes = outcomesOfRacingRotations();
// then
assertThat(outcomes).isSubsetOf("3 draining [1]", "3 draining [1, 2]");
}
/** Races rotate(2) against rotate(3) on a profile at generation 1, round after round. */
private static Set<String> outcomesOfRacingRotations() throws Exception {
ExecutorService pool = Executors.newFixedThreadPool(2);
try {
Set<String> outcomes = new TreeSet<>();
for (int round = 0; round < 1000; round++) {
GrpcChannelRuntimeRegistry registry =
new GrpcChannelRuntimeRegistry(GrpcChannelDrainPolicy.stable());
registry.install(generation(1));
CyclicBarrier start = new CyclicBarrier(2);
Future<?> a = pool.submit(() -> rotateIgnoringRefusal(registry, start, 2));
Future<?> b = pool.submit(() -> rotateIgnoringRefusal(registry, start, 3));
a.get();
b.get();
outcomes.add(
registry.require(PROFILE).generation().generation()
+ " draining "
+ registry.draining(PROFILE).stream()
.map(runtime -> runtime.generation().generation())
.sorted()
.toList());
}
return outcomes;
} finally {
pool.shutdownNow();
}
}
private static Void rotateIgnoringRefusal(
GrpcChannelRuntimeRegistry registry, CyclicBarrier start, long next) throws Exception {
start.await();
try {
registry.rotate(generation(next), NOW);
} catch (IllegalArgumentException refused) {
// the other rotator installed a newer generation first
}
return null;
}
}
@@ -122,8 +122,10 @@ class GrpcTypedStubFactoryTest {
GrpcStubPolicyApplier.CallPolicy generous = applier.applyTo(GET, Duration.ofSeconds(30));
GrpcStubPolicyApplier.CallPolicy tight = applier.applyTo(GET, Duration.ofMillis(300));
assertThat(generous.deadline().remaining()).isEqualTo(Duration.ofMillis(1800));
assertThat(tight.deadline().remaining()).isEqualTo(Duration.ofMillis(100));
// The budget is live: a few milliseconds have passed since applyTo computed it.
assertThat(generous.deadline().remaining())
.isBetween(Duration.ofMillis(1700), Duration.ofMillis(1800));
assertThat(tight.deadline().remaining()).isBetween(Duration.ZERO, Duration.ofMillis(100));
assertThat(tight.waitForReady().queue()).isFalse();
}
}