fix: github sync overlap/#711#712
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces concurrency control to the GitHub stats synchronization scheduler using an AtomicBoolean to prevent overlapping executions, removes the class-level @transactional annotation from GithubDailyStatsSyncService, and adds corresponding unit tests. Feedback highlights a critical issue where a failure during the sync action causes runExclusive to return false, which incorrectly skips the subsequent zero EXP initialization. Additionally, it is noted that while AtomicBoolean works for single-instance deployments, a distributed lock mechanism should be considered for multi-instance environments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| private final GithubDailyStatsSyncService syncService; | ||
| private final GithubExpGrantService githubExpGrantService; | ||
| private final ZeroRankingDataInitService zeroRankingDataInitService; | ||
| private final AtomicBoolean syncRunning = new AtomicBoolean(false); |
There was a problem hiding this comment.
현재 중복 실행 방지를 위해 AtomicBoolean을 사용하고 있습니다. 이 방식은 단일 JVM 인스턴스 내에서는 동시성을 안전하게 제어할 수 있지만, 만약 애플리케이션이 다중 인스턴스(Multi-instance / Clustered environment)로 배포되는 환경이라면 인스턴스 간의 중복 실행을 막을 수 없습니다.
향후 스케일아웃 환경을 고려한다면, DB를 활용한 분산 락(ShedLock 등)이나 Redis 기반의 분산 락을 도입하여 다중 서버 환경에서도 안전하게 중복 실행을 방지하는 것을 권장합니다. 현재 단일 인스턴스 환경이라면 이대로 사용해도 무방하지만, 아키텍처 확장성을 위해 참고해 주세요.
변경사항
관련 이슈
Closes #711
추가 컨텍스트