riemenschneider opened a new pull request, #18788: URL: https://github.com/apache/iceberg/pull/18788
`VendedAzureSasCredentialPolicy` published the volatile `azureSasCredential` before it assigned the plain `azureSasCredentialPolicy` that `process` and `processSync` dereference. A thread that reads the credential as non-null skips the lock and can find the policy still null, which fails the first requests through a new `ADLSFileIO` with a `NullPointerException`. The policy field is now the volatile guard and the credential is assigned before it, so a thread that sees the policy also sees the credential. The test needs at least two CPUs and is skipped otherwise. Closes #18786. Test plan: `TestVendedAzureSasCredentialPolicyConcurrency` sends the first requests of up to 8 threads through a new policy, 20,000 times. It fails on `main` with the NPE (4 of 4 runs on a 20 core machine) and passes with this change. Ran `spotlessApply`, `checkstyleMain`, `checkstyleTest` and `:iceberg-azure:test` (76 tests, 0 failures). --- **AI Disclosure** - Model: Claude Sonnet 5.5 - Platform/Tool: Claude Code - Human Oversight: partially reviewed. The fix, the test and the commit are generated. I reviewed the full diff and this description. I did not run the Gradle checks myself; the spotless, checkstyle and test runs were done by the agent. Areas of uncertainty: the test is timing based, and its failure rate on small CI runners is unknown. - Prompt Summary: Find the cause of an NPE in the Azure vended-credential policy, write a concurrency test and the fix, and run the Gradle checks. The fix, the test and the commit are generated. -- 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]
