Skip to content

Conversation

@adutra
Copy link
Contributor

@adutra adutra commented Jun 25, 2025

If initialization fails, for example when fetching the config, the AuthManager won't be properly closed and will leak resources.

Same for the catalog's RESTClient or AuthSession, if some error is thrown before they are added to the CloseableGroup.

If initialization fails, for example when fetching the config, the AuthManager won't be properly closed and will leak resources.

Same for the catalog's RESTClient or AuthSession, if some error is thrown before they are added to the CloseableGroup.
@github-actions github-actions bot added the core label Jun 25, 2025
Copy link
Contributor

@nastra nastra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes LGTM but wouldn't we have a similar issue in other places where the auth manager is used, such as VendedAdlsCredentialsProvider/ OAuth2RefreshCredentialsHandler? I think in those two classes the CloseableGroup should be instantiated much earlier and managed outside of the close() method

@adutra
Copy link
Contributor Author

adutra commented Jun 25, 2025

changes LGTM but wouldn't we have a similar issue in other places where the auth manager is used, such as VendedAdlsCredentialsProvider/ OAuth2RefreshCredentialsHandler? I think in those two classes the CloseableGroup should be instantiated much earlier and managed outside of the close() method

@nastra I think they are fine? As it stands now, in these classes, every closeable field that is written will get closed when the close() method is called. The CloseableGroup is just a trick to avoid a bunch of nested try-finally blocks.

@adutra
Copy link
Contributor Author

adutra commented Jun 25, 2025

Also: CloseableGroup is not serializable, so that would be a problem for VendedAdlsCredentialProvider.

@nastra nastra merged commit 5845e1e into apache:main Jun 26, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants