Skip to content

fix: github sync overlap/#711#712

Merged
hjbin-25 merged 5 commits into
developfrom
fix/github-sync-overlap/#711
Jun 13, 2026
Merged

fix: github sync overlap/#711#712
hjbin-25 merged 5 commits into
developfrom
fix/github-sync-overlap/#711

Conversation

@chaeyn

@chaeyn chaeyn commented Jun 12, 2026

Copy link
Copy Markdown
Member

변경사항

  • GitHub 30일/365일 동기화 스케줄러에 중복 실행을 방지했습니다.
  • 이전 GitHub 동기화가 아직 실행 중이면 다음 동기화는 skip 로그를 남기고 실행하지 않도록 했습니다.
  • GitHub 동기화 완료/실패 로그에 경과 시간을 남겨 장시간 실행 여부를 추적할 수 있게 했습니다.
  • GithubDailyStatsSyncService의 클래스 레벨 @transactional 을 제거했습니다.
  • GitHub 동기화 실행 중 다음 스케줄이 들어오면 365일 동기화와 0 EXP 초기화를 건너뛰는 테스트를 추가했습니다.

관련 이슈

Closes #711

추가 컨텍스트

@chaeyn chaeyn changed the base branch from main to develop June 12, 2026 14:15

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

현재 중복 실행 방지를 위해 AtomicBoolean을 사용하고 있습니다. 이 방식은 단일 JVM 인스턴스 내에서는 동시성을 안전하게 제어할 수 있지만, 만약 애플리케이션이 다중 인스턴스(Multi-instance / Clustered environment)로 배포되는 환경이라면 인스턴스 간의 중복 실행을 막을 수 없습니다.

향후 스케일아웃 환경을 고려한다면, DB를 활용한 분산 락(ShedLock 등)이나 Redis 기반의 분산 락을 도입하여 다중 서버 환경에서도 안전하게 중복 실행을 방지하는 것을 권장합니다. 현재 단일 인스턴스 환경이라면 이대로 사용해도 무방하지만, 아키텍처 확장성을 위해 참고해 주세요.

@hjbin-25 hjbin-25 merged commit af9141f into develop Jun 13, 2026
1 check passed
@hjbin-25 hjbin-25 deleted the fix/github-sync-overlap/#711 branch June 13, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX] GitHub 동기화 중첩 실행으로 인한 리소스 초과 가능성

3 participants