Skip to content

✨ [Feat] 웹소켓 재연결 로직 추가#139

Merged
rlawngjs0313 merged 2 commits into
developfrom
Feat/#138
Jul 10, 2026
Merged

✨ [Feat] 웹소켓 재연결 로직 추가#139
rlawngjs0313 merged 2 commits into
developfrom
Feat/#138

Conversation

@rlawngjs0313

@rlawngjs0313 rlawngjs0313 commented Jul 10, 2026

Copy link
Copy Markdown
Member

♻️ refactor: LSTM 로그 제거

📍 PR 타입 (하나 이상 선택)

  • 기능 추가
  • 버그 수정
  • 의존성, 환경 변수, 빌드 관련 코드 업데이트
  • 기타 사소한 수정

❗️ 관련 이슈 링크

Closed #138

📌 개요

  • 웹소켓 재연결 로직 추가

🔁 변경 사항

  • Retry를 이용한 웹소켓 재연결 로직 추가
  • 지수 증가 방식(1초 -> 2초 -> 4초 ...)으로 업비트 서버 부하 감소

📸 스크린샷

👀 기타 더 이야기해볼 점

✅ 체크 리스트

  • PR 템플릿에 맞추어 작성했어요.
  • 변경 내용에 대한 테스트를 진행했어요.
  • 프로그램이 정상적으로 동작해요.
  • PR에 적절한 라벨을 선택했어요.
  • 불필요한 코드는 삭제했어요.

Summary by CodeRabbit

  • 개선 사항
    • 웹소켓 연결이 실패해도 자동으로 재시도하며, 연결이 장시간 응답하지 않을 경우 세션을 감지하고 재연결합니다.
    • 연결 종료나 전송 오류 발생 시 연결 상태를 자동으로 복구합니다.
    • 웹소켓 관련 오류가 발생하면 일관된 오류 코드와 메시지를 제공합니다.
    • 애플리케이션 종료 시 연결 관리 리소스를 안전하게 정리합니다.
    • 불필요한 내부 가격 계산 로그를 제거해 로그 가독성을 개선했습니다.

♻️ refactor: LSTM 로그 제거
@rlawngjs0313 rlawngjs0313 self-assigned this Jul 10, 2026
@rlawngjs0313 rlawngjs0313 added the ✨ feat 새로운 기능! label Jul 10, 2026
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 24c9c854-876d-48f2-bb1f-69e539f0f35b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch Feat/#138

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/main/java/com/example/scoi/domain/websocket/handler/UpbitTickerHandler.java`:
- Line 38: currentSession은 afterConnectionEstablished에서 기록되고 closeSession에서 읽히므로
스레드 간 가시성이 보장되도록 volatile로 선언하세요. UpbitTickerHandler의 currentSession 필드 선언에
volatile을 추가하고, 다른 로직은 변경하지 마세요.
- Around line 76-80: 전송 오류 시 handleTransportError()와 afterConnectionClosed()에서
DisconnectedEvent가 중복 발행되지 않도록 수정하세요. 두 메서드 중 한 곳에서만 이벤트를 발행하거나,
UpbitTickerHandler의 onDisconnected()/connectWithRetry() 진입부에 동시 재연결을 막는 가드를 추가해
한 번만 실행되도록 보장하세요.

In `@src/main/java/com/example/scoi/domain/websocket/WebsocketConnect.java`:
- Around line 65-68: WebsocketConnect.recover(Exception e)가 최대 재시도 초과 후 로그만 남겨
영구적으로 연결이 끊깁니다. recover에서 주기적 재연결을 재개할 수 있도록 스케줄러 기반 재시도 또는 재연결 트리거를 연동하고, 필요하면
알림·헬스체크 상태도 갱신하여 애플리케이션 재시작 없이 복구되도록 수정하세요.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 90362309-1fa3-44a3-9846-ea7aa6a38db5

📥 Commits

Reviewing files that changed from the base of the PR and between 0d3e58f and d052a5f.

📒 Files selected for processing (6)
  • src/main/java/com/example/scoi/domain/websocket/WebsocketConnect.java
  • src/main/java/com/example/scoi/domain/websocket/code/WebsocketErrorCode.java
  • src/main/java/com/example/scoi/domain/websocket/event/WebsocketConnectionEvent.java
  • src/main/java/com/example/scoi/domain/websocket/exception/WebsocketException.java
  • src/main/java/com/example/scoi/domain/websocket/handler/UpbitTickerHandler.java
  • src/main/java/com/example/scoi/domain/websocket/service/WebSocketService.java
💤 Files with no reviewable changes (1)
  • src/main/java/com/example/scoi/domain/websocket/service/WebSocketService.java

Comment thread src/main/java/com/example/scoi/domain/websocket/handler/UpbitTickerHandler.java Outdated
@rlawngjs0313 rlawngjs0313 merged commit edfc10e into develop Jul 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feat 새로운 기능!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant