Skip to content

[#29] 예약 만료 - #33

Open
Kming9 wants to merge 2 commits into
developfrom
feature/29-reservation-expiry
Open

Kming9 wants to merge 2 commits into
developfrom
feature/29-reservation-expiry

Conversation

@Kming9

@Kming9 Kming9 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

개요

관련 Issue와 작업 목적을 간단히 작성합니다.

작업 내용

주요 변경 사항을 항목별로 작성합니다.

  • 스케줄러
    • 주기: 1초
    • 결제 제한 시각이 지난 예약을 만료 상태로 변경 후 재고 복구
    • 공연별로 만료 처리
    • 한 공연의 만료 처리가 실패해도 다른 공연은 계속 처리
    • 다른 트랜잭션이 재고 락을 보유한 공연은 대기하지 않고 건너뜀
  • 예약 신청 및 공연 수정 시 해당 공연의 결제 제한 시각이 지난 예약을 먼저 만료하여 재고 정합성 유지
    • 스케줄러의 처리 지연이나 실패로 남아 있는 만료 대상도 반영
  • 만료 대상 조회용 인덱스 추가
  • 예약 동시성 테스트 코드를 공통 유틸로 추출

테스트

작성한 테스트와 실행 결과를 작성합니다.

  • 스케줄러, 예약 신청, 공연 수정에서 결제 제한 시각이 지난 예약만 만료되고 재고가 복구되는지 확인
  • 동시 만료 시 재고가 중복 복구되지 않는지 확인
  • 다른 트랜잭션이 재고 락을 보유한 공연은 스케줄러가 기다리지 않고 건너뛰는지 확인
  • 한 공연의 만료 처리가 실패해도 다른 공연을 처리하는지 확인

@Kming9
Kming9 requested a review from roam-f-lab November 26, 2026 03:30
@Kming9 Kming9 self-assigned this Nov 26, 2026
@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f8fc1062-fe6d-4946-a4e2-d3ef0252fa1f
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@sonarqubecloud

Copy link
Copy Markdown

@Transactional
public Reservation reserve(Long memberId, Long performanceId, int quantity) {
PerformanceStock stock = stockLocker.lock(performanceId);
PerformanceStock stock = stockLocker.lockAndExpireOverdue(performanceId);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

예약이 아직 전혀 없는 상황에서 서로 다른 공연 예약이 동시에 들어오면 어떻게 되나요?


// when
List<Boolean> results =
runConcurrently(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

두 스레드가 동시에 실행되면서 트랜잭션이 겹치는 것을 보장할 수 없을 텐데 확인해 주세요.

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