rsrkpatwari1234 opened a new pull request, #17523: URL: https://github.com/apache/pinot/pull/17523
Fixes #16231 When the /segments controller API encountered a FileNotFoundException, it exhibited below issues - 1. Unnecessary retries: The segment fetcher retried 3 times even though the file didn't exist, wasting time and resources 2. Wrong HTTP status code: The API returned HTTP 500 (Internal Server Error) instead of HTTP 404 (Not Found) 3. Obscured root cause: The original FileNotFoundException was wrapped in AttemptsExceededException, making debugging difficult In this PR, I have implemented two improvements - 1. Skip retries for FileNotFoundException: Modified `BaseSegmentFetcher` to detect FileNotFoundException in the exception cause chain and fail immediately without retrying 2. Return HTTP 404: Modified `PinotSegmentUploadDownloadRestletResource` to catch FileNotFoundException and return Response.Status.NOT_FOUND instead of 500 Unit Tests ✅ 4 new tests added to verify FileNotFoundException behaviour ✅ All existing tests pass - no breaking changes `bugfix` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
