Skip to content

fix: SlackApiService RestTemplate 타임아웃 설정#343

Merged
yoon6yo merged 1 commit into
developfrom
fix/slack-resttemplate-timeout-337
Jul 12, 2026
Merged

fix: SlackApiService RestTemplate 타임아웃 설정#343
yoon6yo merged 1 commit into
developfrom
fix/slack-resttemplate-timeout-337

Conversation

@yoon6yo

@yoon6yo yoon6yo commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #337

new RestTemplate()은 타임아웃이 없어 Slack이 느리거나 무응답일 때 스레드를 무기한 점유 — 알림 큐 worker 스레드 고갈로 이어질 수 있음.

SimpleClientHttpRequestFactory로 커넥션 3초 / 읽기 5초 타임아웃 설정.

Test plan

  • Slack Webhook 정상 전송 확인
  • Slack DM 정상 전송 확인

타임아웃 없는 RestTemplate은 Slack 응답 지연 시 스레드를 무기한 점유할 수 있음.
커넥션 타임아웃 3초, 읽기 타임아웃 5초로 설정.
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 60bc669b-1356-4341-b59c-d6c628eb27de

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 fix/slack-resttemplate-timeout-337

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +34 to +39
private static RestTemplate createRestTemplate() {
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setConnectTimeout(3_000);
factory.setReadTimeout(5_000);
return new RestTemplate(factory);
}
Comment on lines +32 to +36
private final RestTemplate restTemplate = createRestTemplate();

private static RestTemplate createRestTemplate() {
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setConnectTimeout(3_000);
@yoon6yo
yoon6yo merged commit f9294f4 into develop Jul 12, 2026
2 checks passed
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.

fix: SlackApiService RestTemplate 타임아웃 미설정 → 스레드 고갈 위험

2 participants