Skip to content

Conversation

@luoyuxia
Copy link
Contributor

Purpose

Linked issue: close #166

Brief change log

Tests

API and Format

Documentation

@luoyuxia luoyuxia force-pushed the improve-creditial-cache branch from a65eb61 to 935ef50 Compare January 25, 2026 10:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces SecurityTokenManager to handle security token refreshes in a background task, replacing the synchronous CredentialsCache approach. This follows the pattern from the Java client, addressing issue #166 by moving credential fetching out of the fetch response handling path and into a dedicated background refresh loop.

Changes:

  • Replaced CredentialsCache with SecurityTokenManager that runs a background task to periodically refresh security tokens based on expiration time
  • Modified RemoteLogDownloader to accept a CredentialsReceiver (watch channel) instead of requiring explicit credential updates via set_remote_fs_props()
  • Updated LogFetcher to create and start the SecurityTokenManager on initialization, subscribing to credential updates for the remote log downloader

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
crates/fluss/src/client/credentials.rs Replaces CredentialsCache with SecurityTokenManager implementing a background token refresh loop using tokio watch channels for broadcasting updates
crates/fluss/src/client/table/scanner.rs Updates LogFetcher to instantiate and start SecurityTokenManager, subscribing to credentials for RemoteLogDownloader; removes synchronous credential fetching from fetch response handling
crates/fluss/src/client/table/remote_log.rs Modifies RemoteLogDownloader and ProductionFetcher to receive credentials via watch channel receiver; removes set_remote_fs_props() method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@luoyuxia
Copy link
Contributor Author

@zhaohaidao Could you please help review when you got some time?

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.

move CredentialsCache get out from handle fetch result

1 participant