fix(user-creator-chat): Redis 전달 예외 fallback 범위를 좁힌다

This commit is contained in:
2026-06-19 05:35:53 +09:00
parent 07b93f3219
commit 6c252ee008
3 changed files with 130 additions and 20 deletions

View File

@@ -803,6 +803,15 @@ spring:
- Fresh lint Result: `BUILD SUCCESSFUL in 7s`.
- Fresh 전체 검증 Run: `./gradlew --no-daemon test -Dkotlin.compiler.execution.strategy=in-process`
- Fresh 전체 검증 Result: `BUILD SUCCESSFUL in 1m 52s`.
- 잔여 리스크 개선:
- 대상: `UserCreatorChatService.deliverRealtime`
- 무엇: Redis/WebSocket 전달 경계의 fail-open 처리 범위를 전체 `Exception`에서 Redis 접근 예외인 `DataAccessException`으로 좁히고, Redis 오류는 warn 로그를 남긴 뒤 푸시 발송으로 fail-open 하도록 정리했다. Redis 계층이 아닌 broker 예외는 숨기지 않고 전파한다.
- 왜: Redis 장애 시 메시지 저장 후 푸시 발송 요구사항은 유지하되, 프로그래밍 오류나 예상하지 못한 런타임 오류까지 푸시 fallback으로 숨기지 않기 위해서다.
- RED: `UserCreatorChatServiceTest.shouldPropagateNonRedisBrokerExceptionDuringVoiceMessage`를 추가했다. 기존 `runCatching` 구현에서는 `IllegalStateException`이 전파되지 않아 `AssertionFailedError`로 실패했다.
- GREEN: `DataAccessException`만 catch하도록 수정한 뒤 `./gradlew --no-daemon test -Dkotlin.compiler.execution.strategy=in-process -Dspring.jpa.open-in-view=false --tests kr.co.vividnext.sodalive.v2.usercreatorchat.UserCreatorChatServiceTest``BUILD SUCCESSFUL in 3m 33s`로 통과했다.
- 인접 회귀: `./gradlew --no-daemon test -Dkotlin.compiler.execution.strategy=in-process -Dspring.jpa.open-in-view=false --tests kr.co.vividnext.sodalive.v2.usercreatorchat.UserCreatorChatServiceTest --tests kr.co.vividnext.sodalive.fcm.FcmServiceTest --tests 'kr.co.vividnext.sodalive.v2.usercreatorchat.websocket.*'``BUILD SUCCESSFUL in 38s`로 통과했다.
- Lint: import 정렬 수정 후 `./gradlew --no-daemon ktlintCheck``BUILD SUCCESSFUL in 21s`로 통과했다.
- 전체 회귀: `./gradlew --no-daemon test -Dkotlin.compiler.execution.strategy=in-process -Dspring.jpa.open-in-view=false``BUILD SUCCESSFUL in 4m 39s`로 통과했다.
- Phase 3:
- Run: `./gradlew --no-daemon test -Dkotlin.compiler.execution.strategy=in-process --tests kr.co.vividnext.sodalive.v2.usercreatorchat.websocket.UserCreatorChatRedisIntegrationTest`
- RED Result: 테스트 파일 부재 상태에서 `No tests found for given includes`로 실패했다.