Skip to content

Conversation

tvainika
Copy link
Contributor

@tvainika tvainika commented Oct 9, 2025

Gcs credentials are automatically reloaded if gcs.credentials.path is used to define the credentials in a separate json file.

@tvainika tvainika marked this pull request as ready for review October 9, 2025 13:50
@tvainika tvainika requested a review from a team as a code owner October 9, 2025 13:50
Gcs credentials are automatically reloaded if gcs.credentials.path is
used to define the credentials in a separate json file.
@tvainika tvainika force-pushed the tvainika/reloading-gcs-credentials branch from ca7fc71 to 59d0746 Compare October 10, 2025 08:57
* Closes the credentials provider to stop file watching.
* This should be called when the storage backend is being shut down.
*/
public void close() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This close is not being called from anywhere else I think. We should call it to avoid leaving resources hanging.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see S3 version also doesn't have a close method. May be worth adding it there also.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In my understanding S3 works so that S3Client (implemented in AWS SDK) receives an instance of S3RotatingCredentialsProvider, which implements AutoCloseable, and then it is S3Client's responsibility to call that close. So in there SDK does a bit more if I've understood correctly.

But you seem to be right that here this close is not being called. I think this might need some changes in outside Gcs parts, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we need something similar to aiven/inkless#430

Comment on lines +65 to +69
this.scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(r -> {
final Thread t = new Thread(r, "s3-credentials-watcher");
t.setDaemon(true);
return t;
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you elaborate on why is this needed?
Also, maybe a separate commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added just naming of the thread for consistency. But true, should be separate commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants