[WatchingSession] 레디스 TTL 배치로 갱신, 레디스나 웹소켓 서버 비정상 종료시 대응 추가#124
Merged
[WatchingSession] 레디스 TTL 배치로 갱신, 레디스나 웹소켓 서버 비정상 종료시 대응 추가#124
Conversation
- Heartbeat에서 Redis 호출 제거, 인메모리 lastActiveTime만 갱신 - 하트비트 시 마다 갱신하면 유저 증가시 처리량 폭발하는걸 대비하여 배치로 처리하도록 결정 - 30초 주기 배치로 JWT 검증 및 Redis TTL 일괄 갱신 - JWT 만료 시 WebSocket 강제 종료 (CloseStatus 4001) - WebSocketSession 보관을 위한 Holder/Decorator 추가
…에 정리 로직추가 - WebSocketSessionHolder에 이미 웹소켓 세션이 있는데 이를 세션맵핑에 까지 저장하면 유지보수 복잡도 올라가고 SRP 위반이기에 Holder에서만 실제 웹소켓 세션 정보를 가지도록 변경 - 웹소켓 서버가 비정상 종료되었을 때 레디스 Sorted Set에 콘텐츠별 시청 세션을 담는 곳에 시청자 수가 정리안되는 문제 발견, 재시작시 이를 해결하기 위해서 비정상 세션들 삭제
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.
PR 요약
레디스 TTL 배치로 갱신, 레디스나 웹소켓 서버 비정상 종료시 대응 추가
체크리스트
상세 설명
WebSocketSessionHolder에 이미 웹소켓 세션이 있는데 이를 세션맵핑에 까지 저장하면 유지보수 복잡도 올라가고 SRP 위반이기에 Holder에서만 실제 웹소켓 세션 정보를 가지도록 변경
웹소켓 서버가 비정상 종료되었을 때 레디스 Sorted Set에 콘텐츠별 시청 세션을 담는 곳에 시청자 수가 정리안되는 문제 발견, 재시작시 이를 해결하기 위해서 비정상 세션들 삭제
검증 단계
추가 코멘트