fix: Telegram 409 다중 인스턴스 충돌 시 WARNING + 30초 백오프 (#180) #185

Merged
jihoson merged 2 commits from feature/issue-180-telegram-instance-lock into main 2026-02-20 09:52:15 +09:00
Collaborator

Summary

  • 다중 인스턴스 실행 시 Telegram getUpdates 409 충돌을 ERROR 대신 WARNING으로 처리
  • 충돌 감지 시 30초 동안 polling 일시 중단하여 서버 부하 및 로그 노이즈 감소
  • "another instance is polling" 명확한 안내 메시지 출력

Fixes

Test plan

  • test_get_updates_409_sets_conflict_backoff — 409 시 백오프 설정 확인
  • test_poll_loop_skips_during_conflict_backoff — 백오프 중 polling 스킵 확인
  • 전체 테스트 719개 통과

🤖 Generated with Claude Code

## Summary - 다중 인스턴스 실행 시 Telegram getUpdates 409 충돌을 ERROR 대신 WARNING으로 처리 - 충돌 감지 시 30초 동안 polling 일시 중단하여 서버 부하 및 로그 노이즈 감소 - "another instance is polling" 명확한 안내 메시지 출력 ## Fixes - closes #180 ## Test plan - [x] `test_get_updates_409_sets_conflict_backoff` — 409 시 백오프 설정 확인 - [x] `test_poll_loop_skips_during_conflict_backoff` — 백오프 중 polling 스킵 확인 - [x] 전체 테스트 719개 통과 🤖 Generated with [Claude Code](https://claude.com/claude-code)
agentson added 1 commit 2026-02-20 09:31:14 +09:00
fix: Telegram 409 충돌 시 WARNING 로그 + 30초 백오프 적용 (#180)
Some checks failed
CI / test (pull_request) Has been cancelled
77577f3f4d
다중 인스턴스 실행 시 Telegram getUpdates 409 응답을 ERROR가 아닌 WARNING으로
처리하고, 30초 동안 polling을 일시 중단하여 충돌을 완화.

- _conflict_backoff_until 속성 추가
- 409 감지 시 명확한 "another instance is polling" 메시지 출력
- poll_loop에서 백오프 활성 중 polling 스킵
- TestGetUpdates에 409 관련 테스트 2개 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner

이건 종료 시켜야 하지 않아?

이건 종료 시켜야 하지 않아?
agentson added 1 commit 2026-02-20 09:35:39 +09:00
fix: Telegram 409 감지 시 백오프 대신 polling 즉시 종료 (#180)
Some checks failed
CI / test (pull_request) Has been cancelled
aceba86186
409 충돌 감지 시 30초 백오프 후 재시도하는 방식에서
_running = False로 polling을 즉시 중단하는 방식으로 변경.

다중 인스턴스가 실행 중인 경우 재시도는 의미 없고 충돌만 반복됨.
이제 409 발생 시 이 프로세스의 Telegram 명령어 polling을 완전히 비활성화.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
Collaborator

맞습니다. 백오프 후 재시도는 충돌만 반복되는 구조였습니다.

코드 수정:

  • 409 감지 시 _running = False로 polling을 즉시 종료
  • _conflict_backoff_until 필드 및 관련 로직 제거
  • 테스트도 backoff 테스트 → polling 종료 테스트로 교체

최신 커밋 반영했습니다.

맞습니다. 백오프 후 재시도는 충돌만 반복되는 구조였습니다. 코드 수정: - 409 감지 시 `_running = False`로 polling을 즉시 종료 - `_conflict_backoff_until` 필드 및 관련 로직 제거 - 테스트도 backoff 테스트 → polling 종료 테스트로 교체 최신 커밋 반영했습니다.
jihoson merged commit 9927bfa13e into main 2026-02-20 09:52:15 +09:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#185