fix: SlackApiService RestTemplate 타임아웃 설정#343
Conversation
타임아웃 없는 RestTemplate은 Slack 응답 지연 시 스레드를 무기한 점유할 수 있음. 커넥션 타임아웃 3초, 읽기 타임아웃 5초로 설정.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Pull request overview
Slack API 호출에 사용되는 RestTemplate에 커넥션/읽기 타임아웃을 추가해, Slack 응답 지연/무응답 상황에서 워커 스레드가 무기한 블로킹되는 리스크를 줄이려는 변경입니다. 알림(특히 큐 기반 worker) 안정성 측면에서 #337의 문제의식을 코드로 반영합니다.
Changes:
SlackApiService내부RestTemplate생성 시SimpleClientHttpRequestFactory를 사용해 connect/read timeout을 설정RestTemplate생성 로직을 정적 팩토리 메서드로 분리
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private static RestTemplate createRestTemplate() { | ||
| SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); | ||
| factory.setConnectTimeout(3_000); | ||
| factory.setReadTimeout(5_000); | ||
| return new RestTemplate(factory); | ||
| } |
| private final RestTemplate restTemplate = createRestTemplate(); | ||
|
|
||
| private static RestTemplate createRestTemplate() { | ||
| SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); | ||
| factory.setConnectTimeout(3_000); |
Summary
Closes #337
new RestTemplate()은 타임아웃이 없어 Slack이 느리거나 무응답일 때 스레드를 무기한 점유 — 알림 큐 worker 스레드 고갈로 이어질 수 있음.SimpleClientHttpRequestFactory로 커넥션 3초 / 읽기 5초 타임아웃 설정.Test plan