suvodeep-pyne opened a new pull request, #17869: URL: https://github.com/apache/pinot/pull/17869
## Summary - Fix thread leak caused by `StsClient` and `StsAssumeRoleCredentialsProvider` being created as local variables in `initOrRefreshS3Client()` — never stored as fields, never closed on refresh, and not closed in `close()`. Each leaked provider spawns `sdk-cache-*` background threads that accumulate indefinitely. - Observed in production: 91 `sdk-cache` threads (1,338 total) on a controller over 4.6 days. - Store STS resources as instance fields and close old ones **after** building the new client (avoids a window where concurrent S3 operations could hit a closed credential provider). - Synchronize `initOrRefreshS3Client()` and `close()` on `_clientLock` to prevent races between credential refresh and shutdown. ## Test plan - [x] `mvn compile` passes - [x] Existing unit tests pass (tests use `init(S3Client)` path — no IAM role — so they validate no regression on the non-IAM path) - [ ] Manual verification on a staging environment with IAM role-based access to confirm `sdk-cache-*` thread count stays stable across credential refreshes -- 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]
