[Fix] #588 - 친구 추천 시 Platform 조회 전 사전 샘플링으로 414 방지 + RandomPicker를 ThreadLocalRandom으로 전환 #589
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.
Related issue 🛠
Work Description ✏️
플랫폼(auth) 조회 전에 후보 ID를 (size×5, 최대 50개)로 미리 샘플링하여 넘기도록 변경했습니다. 또한 RandomPicker를 ThreadLocalRandom 기반으로 교체했습니다. 그 결과 URI 길이가 항상 짧게 유지되어 414가 재발하지 않습니다.
배경 / 문제상황
원인 분석
변경 사항
참고사항) 컨트롤러/Facade 등 외부 인터페이스 변경 없음. 최종 size 맞추기는 기존대로 바깥 RandomPicker.pickRandom(..., size)가 담당합니다(코드 변경 최소화).
기대 상황
GET /api/v1/users?userIds=... URI 길이 ≈ < 1KB 수준으로 유지 → 414 임계(보통 8~16KB) 를 확실히 피함.
Trouble Shooting ⚽️
Related ScreenShot 📷
Uncompleted Tasks 😅
향후 개선(장기)
→ 쿼리 파라미터 대신 바디 전달로 구조적으로 URI 길이 이슈 제거
→ 배치 크기 100~200까지도 안전 운용 가능
To Reviewers 📢