yayaha opened a new pull request, #18817: URL: https://github.com/apache/iceberg/pull/18817
`ResolvingFileIO.io()` resets the credentials of an existing delegate when they differ from the credentials of the `ResolvingFileIO`. The `ResolvingFileIO` keeps the credentials from table load. Since #15678 and #15696, `S3FileIO` and `GCSFileIO` refresh the credentials they hold before the credentials expire. After the first refresh, each `io()` call resets the delegate to the credentials from table load. The reset cancels the scheduled refresh and closes the storage clients. The next file operation builds new clients from credentials that are close to expiry, so the delegate fetches credentials again. This repeats on each file operation. A FileIO serialized after a reset also carries the old credentials. This change removes the reset from `io()`. `setCredentials` now updates the existing delegates, so new credentials from the caller still reach them. A delegate that refreshes its credentials keeps them. This affects `GCSFileIO` when the catalog sends `gcs.oauth2.refresh-credentials-endpoint`. It affects `S3FileIO` when its scheduled refresh succeeds, for example when `credentials.uri` is set. With a REST catalog, that refresh fails today (#17810). #17912 fixes it, so `S3FileIO` with a REST catalog is affected once #17912 merges. Testing: `./gradlew :iceberg-core:test --tests org.apache.iceberg.io.TestResolvingIO`. The new tests `delegateKeepsItsRefreshedCredentials` and `setCredentialsUpdatesExistingDelegates` fail without this change. --- **AI Disclosure** - Model: Claude Opus 5.5 - Platform/Tool: Claude Code - Human Oversight: [unknown - human to fill in] - Prompt Summary: Find why `ResolvingFileIO` undoes the credential refresh of its delegates, and fix it with tests. This pull request and its description were written by Isaac. -- 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]
