fix: RestTemplate에 연결 및 응답 타임아웃 설정 - #420
Merged
Merged
Conversation
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.
✅ PR 설명
RestTemplateConfig가 new RestTemplate()을 그대로 반환해서 연결 및 응답 타임아웃이 무한이었습니다.
Toss 등 외부 API가 응답하지 않거나 지연되면 톰캣 워커 스레드가 해당 요청에 무한정 묶이고, 이런 요청이 쌓이면 스레드 풀이 고갈되어 결제 연동 장애가 서비스 전체 장애로 전이될 수 있었습니다.
이에 SimpleClientHttpRequestFactory에 연결은 3초, 응답은 10초 타임아웃을 설정해서 외부 서버 지연이 우리 서비스 가용성으로 번지지 않도록 격리했습니다.
🏗 작업 내용
📸 테스트 결과 (선택)
🔗 관련 이슈 (선택)
🚨 참고 사항 (선택)