Skip to content

fix(waiting): Vegas queueDepth 기준 변경 및 TTL 만료 deactivate 처리 [KAN-306]#49

Closed
lian2945 wants to merge 14 commits into
mainfrom
feat/306
Closed

fix(waiting): Vegas queueDepth 기준 변경 및 TTL 만료 deactivate 처리 [KAN-306]#49
lian2945 wants to merge 14 commits into
mainfrom
feat/306

Conversation

@lian2945

@lian2945 lian2945 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

관련 이슈

KAN-306

변경 사항

1. AIMD queueDepth 기준 변경 (AdmissionScheduler)

  • 기존: admissionQueuePort.getActiveCount() (입장 후 구매 미완료 유저 수)
  • 변경: waitingQueuePort.getQueueSize() (실제 대기열 인원 수)
  • 대기자가 많을수록 batchSize를 늘려야 하는 Vegas 알고리즘 의도에 맞게 수정
  • 기존 구현에서는 대기열이 49명이어도 activeCount가 alpha~beta 구간에 고착되어 batchSize가 변하지 않는 문제 발생

2. purchase_token TTL 만료 시 deactivate 처리 (PurchaseTokenExpiredListener)

  • Redis keyspace notification 기반 KeyExpirationEventMessageListener 구현
  • purchase_token:{releaseId}:{userId} 키 만료 이벤트 감지 → admissionQueuePort.deactivate() 호출
  • 기존에는 토큰이 TTL 만료되어도 activeCount가 감소하지 않아 queueDepth가 계속 누적되는 버그 수정

3. RedisMessageListenerContainer 빈 등록 (WaitingConfiguration)

  • keyspace notification 리스너 동작에 필요한 컨테이너 빈 추가

테스트 체크리스트

  • 대기열에 다수 인원 진입 시 batchSize가 점진적으로 증가하는지 확인
  • purchase_token TTL 만료 후 waiting:active:{releaseId} 카운터가 감소하는지 Redis에서 확인
  • 구매 완료(토큰 소비) 시 기존 deactivate 정상 동작 확인

🤖 Generated with Claude Code

lian2945 and others added 14 commits June 21, 2026 15:10
…293]

- CreatorGrpcAdapter: BlockingStub → FutureStub, withDeadlineAfter 제거
- @Timelimiter(name = "creatorService") 추가
- 반환 타입 CreatorId → CompletableFuture<CreatorId> 전환
- fallback 반환 타입도 CompletableFuture<CreatorId>로 통일
- CreatorIdQueryPort: 반환 타입 CompletableFuture<CreatorId>로 업데이트
- 서비스 레이어: getCreatorId().join() 호출로 변경

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…h") 제거 [KAN-289]

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n import 제거 [KAN-289]

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… 전 계층 제거 [KAN-293]

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…[KAN-289]

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- OAuth2Provider에 LOCAL 추가
- User 도메인에 passwordHash 필드 및 createEmailBuilder 추가
- SignupWithEmail / LoginWithEmail UseCase 및 Service 구현
- UserGrpcService에 signupWithEmail / loginWithEmail RPC 추가
- BCryptPasswordEncoder 빈 등록 (SecurityConfiguration)
- findByEmail 쿼리 및 DuplicateEmailException / InvalidPasswordException 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- POST /auth/signup: BCrypt 해싱 → user 서비스 gRPC → 토큰 발급
- POST /auth/email-login: user 서비스에서 BCrypt 검증 → 토큰 발급
- UserEmailGrpcAdapter: EmailUserPort 구현 (FutureStub + CircuitBreaker + TimeLimiter)
- BCryptPasswordEncoder 빈 등록 (SecurityConfiguration)
- SignupService / EmailLoginService: 기존 LoginService 토큰 발급 패턴 재사용

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- AIMD 계산 기준을 admissionQueue activeCount → waitingQueue 대기 수로 변경
  (대기자가 많을수록 batchSize를 늘리는 의도에 맞게 수정)
- Redis keyspace notification 기반 PurchaseTokenExpiredListener 추가
  purchase_token TTL 만료 시 admissionQueuePort.deactivate() 호출하여
  active count가 줄지 않던 버그 수정
- RedisMessageListenerContainer 빈 WaitingConfiguration에 등록

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 3, 2026 02:31

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@lian2945 lian2945 closed this Jul 3, 2026
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.

2 participants