Skip to content

[FIX] SockJS xhr 폴백 연결 끊김 시 HttpMessageNotWritableException 알림 제외 #274

Closed

Description

@coli-geonwoo

✨ Description

라이브 공유 중 청중이 SockJS xhr 폴백(xhr, xhr_streaming)으로 연결된 상태에서 연결이 끊기면, 다음과 같은 에러가 Discord 알림으로 전송됩니다.

org.springframework.http.converter.HttpMessageNotWritableException: No converter for [class java.util.LinkedHashMap] with preset Content-Type 'application/javascript;charset=UTF-8'
  • 원인
    • SockJS xhr 전송 핸들러는 응답 Content-Type 을 application/javascript 로 미리 지정합니다.
    • 클라이언트가 연결을 끊으면(nginx 499) /error 로 에러 디스패치되고, BasicErrorController 의 Map 본문을 해당 Content-Type 으로 쓸 수 없어 HttpMessageNotWritableException 이 발생합니다.
    • 이를 GlobalExceptionHandler#handleException(Exception) 이 잡아 서버 에러로 알림을 보냅니다.
  • 실제 서비스 장애가 아닌 클라이언트 연결 끊김으로 인한 2차 예외이므로 알림 대상에서 제외합니다.
    • HttpMessageNotWritableException 전용 @ExceptionHandler 를 추가해 WARN 로그만 남기고 본문 없이 응답합니다.

✨ Time(마감기한)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

fix기능 수정

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions