noob-se7en opened a new pull request, #18644:
URL: https://github.com/apache/pinot/pull/18644

   ## Problem
   
   `S3PinotFS.init(S3Client, String, PinotConfiguration)` (the "bring your own 
client" overload) sets `_s3Client` but leaves the `_s3Config` field `null`. It 
constructs an `S3Config` only as a local variable, used for the 
server-side-encryption / multipart / ACL setup. The single-arg 
`init(PinotConfiguration)` is currently the only method that assigns the 
`_s3Config` field.
   
   Any later operation that goes through the credential-refresh path — 
`retryWithS3CredentialRefresh(...)` → `initOrRefreshS3Client()` — reads 
`_s3Config.getRegion()`. For an instance initialized with a caller-provided 
client, `_s3Config` is still `null`, so the first credential refresh throws a 
`NullPointerException`.
   
   ## Fix
   
   Assign the `S3Config` that the three-arg `init` already constructs to the 
`_s3Config` field (and reuse it for the existing SSE/multipart/ACL calls). No 
extra object construction. The field is now populated, so a later refresh 
rebuilds the client from the same config instead of NPEing.
   
   ## Testing
   
   Adds 
`S3PinotFSInitTest.testInitWithProvidedClientPopulatesConfigForRefresh`: 
initializes via the three-arg `init`, then calls `initOrRefreshS3Client()`. It 
reproduces the `NullPointerException` before this change and passes after. 
Static credentials keep the rebuild fully offline (no S3 mock container 
required).
   


-- 
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]

Reply via email to