Skip to content

feat: 키워드 알림 스레드 분리#2192

Draft
Soundbar91 wants to merge 3 commits intofix/2190-keyword-notificationfrom
feat/2191-separate-keyword-notification-thread
Draft

feat: 키워드 알림 스레드 분리#2192
Soundbar91 wants to merge 3 commits intofix/2190-keyword-notificationfrom
feat/2191-separate-keyword-notification-thread

Conversation

@Soundbar91
Copy link
Collaborator

🔍 개요

Image
  • 키워드 알림 API(POST /articles/keyword/notification)에서 하나의 스레드를 점유하는 문제 발생
  • HTTP 요청/응답을 관리하는 톰켓 스레드에서 키워드 알림 이벤트 발행 후 처리 로직까지 관할하는 건 설계 문제라고 판단
  • 키워드 알림 이벤트 발행 후 처리는 별도의 스레드에서 관할하고, 톰켓 스레드는 HTTP 요청/응답만을 수행하도록 개선

🚀 주요 변경 내용

ThreadPoolTaskExecutor 설정 추가

  • 키워드 알림의 경우 평일에 발생하며, 하루에 3~4번의 API 호출이 발생합니다.
  • 한 번 API가 발생할 경우 이벤트가 4~6개 내외로 발생합니다.
  • 해당 상황을 반영하여 최소 2개, 최대 5개의 스레드풀을 소유하도록 설정했고 대기 큐에는 최대 20개의 작업이 대기하도록 설정했습니다.
  • 대기 큐까지 꽉 찬 경우, 에러로 처리하여 손실하는 것이 아닌 톰켓 스레드가 직접 처리하도록 CallerRunsPolicy 설정을 했습니다.

키워드 알림 이벤트 비동기 처리

  • 스레드 분리를 위해 키워드 알림 이벤트 비동기 처리를 진행했습니다.

💬 참고 사항

  • 작업 관련해서 잘 정리된 블로그 하나 첨부합니다.
  • 작업 간 AI와의 대화 이력 첨부합니다.

✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

@Soundbar91 Soundbar91 self-assigned this Mar 23, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5ccae0a5-f5b1-41ef-83ac-b09739323d2b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/2191-separate-keyword-notification-thread

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the 리팩터링 리팩터링을 위한 이슈입니다 label Mar 23, 2026
@Soundbar91 Soundbar91 marked this pull request as draft March 23, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

리팩터링 리팩터링을 위한 이슈입니다

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant