fix: 보정 스케줄러의 미처리 요청 감지 범위 확장#226
Merged
Ji-minhyeok merged 14 commits intoApr 27, 2026
Merged
Conversation
…uple-participant-count-update # Conflicts: # src/main/java/com/threestar/trainus/domain/lesson/issue/LessonStockReconciliationScheduler.java
…al-project/WEB5_7_3star_BE into refactor/#221/decouple-participant-count-update
…uple-participant-count-update
…nt-count-update' into refactor/#221/decouple-participant-count-update # Conflicts: # src/main/java/com/threestar/trainus/domain/lesson/issue/LessonApplyConsumer.java
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.
🚀 작업 개요
보정 스케줄러가 “MQ가 비었다”는 신호만으로 재고 보정을 수행하던 기존 구조에서 Waiting Room(선점 완료, 미처리 요청) 잔여 여부까지 포함하여 전체 파이프라인의 미처리 요청을 더 보수적으로 감지하도록 개선했습니다.
또한 MQ Stream 상태 확인이 실패한 경우에도 보정을 진행하지 않도록 fail-closed로 변경하여 외부 상태 확인 실패 시 재고를 다시 열지 않도록 하였습니다.
🛠️ 작업 내용
Waiting Room 기반 미처리 요청 감지 추가 (Core Redis)
DIRTY_SET_KEY(lesson:apply:active-lessons)에 등록된 레슨들을 기준으로 각lesson:apply:waiting-room:{lessonId}SortedSet의 잔여 수를 확인MQ Stream Lag 체크 fail-closed 적용 (MQ Redis)
hasStreamLag()에서 Stream/group 조회가 실패한 경우 기존에는 “미처리 없음”으로 간주될 수 있었으나 변경 후에는 상태 확인 실패 시 보정을 연기하도록 처리✅ PR 유형
✅ Check List
🔗 관련 이슈
💬 기타 참고 사항