Repository navigation
fix(execution): 시작된 SSE 응답의 예외 처리와 유휴 연결 하트비트 (#153) - #154
Merged
Merged
Conversation
SSE 응답은 시작할 때 Content-Type 이 text/event-stream 으로 굳는다. 그 뒤 만료·연결 끊김이 나면 공통 핸들러가 ApiResponse JSON 을 쓰려다 실패해 WARN 이 쌓였다. 시작된 SSE 응답에서는 본문을 쓰지 않는다. 이벤트가 없어도 구독 연결에 :keepalive 주석을 15초마다 보내 프록시(Next 기본 30초)의 유휴 종료를 막는다. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
관련 Issue
Closes #153
작업 배경
시연 중 Server 로그에
HttpMessageNotWritableException: No converter for ApiResponse with preset Content-Type 'text/event-stream'WARN 이 쌓이고(오늘 98건), Client 에는Failed to proxy …/events socket hang up가 쌓였다(351줄). 같은 사건의 양쪽이다. 원인은 이슈 #153 에 코드 근거와 함께 적었다.변경 사항
GlobalExceptionHandler.handleException: 응답 Content-Type 이 이미text/event-stream이면 JSON 본문을 쓰지 않고null을 돌려 처리를 끝낸다. 연결 끊김·만료(AsyncRequestTimeoutException,AsyncRequestNotUsableException,IOException)는 debug, 그 밖의 예외는 스택과 함께 warn. 시작 전 오류(401 등)와 일반 요청의 500 은 그대로 JSON.ExecutionSseService.sendHeartbeat: 구독 중인 모든 SSE 연결에:keepalive주석 줄을 주기적으로 보낸다(기본 15초,poppy.execution.sse-heartbeat-milliseconds). Client(executionStream.ts)는event:/data:가 없는 프레임을 무시한다.주요 설계 결정
proxyTimeout기본값이 30초(next@16.3.2)라 유휴 SSE 가 30초마다 끊긴다. Client 설정을 올리는 방법은 프록시 종류(Vercel 등)에 따라 안 먹을 수 있어, 프록시와 무관한 하트비트로 해결한다.검증 결과
SseStreamRealServerTest의 만료·연결 끊김 2건이Failure in @ExceptionHandler …handleException(Exception)WARN 으로 실패. 수정 후 통과.ExecutionSseHeartbeatIntegrationTest: 이벤트 없는 구독에:keepalive가 오고event:/data:는 없음../gradlew test384건 통과,harness-check통과.영향 범위
GlobalExceptionHandler,ExecutionSseService. API 계약·이벤트 형식 변경 없음. 설정 키 1개 추가(선택, 기본 15000).제외 범위
Client 의
proxyTimeout설정 변경. 운영/시연 서비스 재시작(반영은 사람이 한다).체크리스트
🤖 Generated with Claude Code