-
Notifications
You must be signed in to change notification settings - Fork 23
chore: introduce SecurityTokenManager to update token in the background #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
a65eb61 to
935ef50
Compare
There was a problem hiding this 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
CredentialsCachewithSecurityTokenManagerthat runs a background task to periodically refresh security tokens based on expiration time - Modified
RemoteLogDownloaderto accept aCredentialsReceiver(watch channel) instead of requiring explicit credential updates viaset_remote_fs_props() - Updated
LogFetcherto create and start theSecurityTokenManageron 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.
|
@zhaohaidao Could you please help review when you got some time? |
Purpose
Linked issue: close #166
Brief change log
Tests
API and Format
Documentation