Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthrough다중 Worker가 Embedding Job을 동시에 Claim하는 통합 테스트와 전용 Gradle 실행 태스크를 추가했습니다. 단일 Job 경쟁 및 1,000개 Job 소진 시 소유권, Lease, Token, 상태와 LOCKED 이벤트의 정합성을 OpenSQL에서 검증하며 실행·진단 절차도 문서화했습니다. ChangesEmbedding Job Claim 동시성 검증
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Test as EmbeddingJobClaimConcurrencyIntegrationTest
participant Workers as Active Workers
participant Service as EmbeddingJobClaimService
participant DB as OpenSQL
Test->>Workers: 동시 Claim 작업 시작
Workers->>Service: PENDING Job Claim 요청
Service->>DB: FOR UPDATE SKIP LOCKED 및 상태 저장
DB-->>Service: Job 소유권과 LOCKED 이벤트 반환
Service-->>Workers: Claim 결과 반환
Test->>DB: 최종 상태·소유권·이벤트 검증
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Gimini-3
marked this pull request as ready for review
July 24, 2026 02:24
This was referenced Aug 3, 2026
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.
목적
여러 Worker가 동시에 PENDING Embedding Job을 Claim해도 한 Job의 소유권이 정확히 한 번만 Commit되고, 대량 Queue가 중복과 누락 없이 완전히 소진되는지 실제 OpenSQL에서 검증합니다.
Closes #52
변경 내용
claimConcurrencyTest전용 Gradle Task 추가claim-concurrencyTag만 실행test와build에서는 무거운 동시성 테스트 제외EmbeddingJobClaimConcurrencyIntegrationTest추가CountDownLatch로 제어EmbeddingJobClaimService호출LOCKED이벤트 중복·누락 검증동시 실행 개념
시나리오 A — 단일 Job 경쟁
검증 결과:
시나리오 B — Queue 완전 소진
검증 결과:
동시성 경계
100개의 Java Worker 요청을 그대로 100개의 DB Connection으로 연결하지 않고 Hikari Pool을 20개로 제한했습니다. 실제 애플리케이션처럼 Connection Pool Backpressure가 있는 상태에서 요청 Burst가 소유권 정합성을 깨뜨리지 않는지 검증합니다.
Worker별 Claim 건수의 균등성이나 TPS·P95는 합격 기준이 아닙니다.
SKIP LOCKED의 공정성과 성능 비교는 별도의 처리량·Lock 경합 성능 테스트 범위입니다.실제 검증 환경
검증 결과:
claimConcurrencyTest최초 실행 통과claimConcurrencyTest5회 연속 5/5 통과./gradlew clean build통과실행 가이드
docs/test-results/gimin-#52-embedding-job-claim-concurrency.md에 다음 내용을 포함했습니다.docgridDatabase에 실제 SQL을 실행하는 준비 상태 확인시행착오 반영
첫 실행에서 Hikari
connection-timeout을60s문자열로 설정해 ApplicationContext Binding이 실패했습니다. HikariDataSource의 해당 속성이 밀리초long을 받는 것을 실제 Context에서 확인하고60000으로 수정했습니다.또한 OpenSQL 초기화 중
pg_isready는docgridDatabase 생성 전에도 Server 준비를 반환할 수 있어, 가이드에서는 실제docgrid에SELECT 1이 성공할 때까지 기다리도록 했습니다.Production 영향
Production Service, Repository, Entity, Migration은 변경하지 않습니다. 테스트 Task, 통합 테스트, 재현 문서, 학습 기록만 추가합니다.
Summary by CodeRabbit
테스트
문서