-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: Async refresh dry run in parallel with sync refresh #2849
base: main
Are you sure you want to change the base?
Conversation
// module should asynchronously refresh auth token in parallel to sync refresh | ||
// | ||
// errHandler function will be called when there is an error while refreshing | ||
// the token asynchronously |
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.
What should the errHandler function do? Log the error?
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.
No specific requirement on that. User can do whatever they need to
Can this change be made upstream instead with an embedded private option: https://pkg.go.dev/google.golang.org/api/option/internaloption#EmbeddableAdapter |
No. the token refresh code is deep into this library and not Bigtable. |
// | ||
// This is an EXPERIMENTAL option and will be removed in the future. | ||
// TODO(b/372244283): Remove after b/358175516 has been fixed | ||
func EnableAsyncRefreshDryRun(errHandler func()) option.ClientOption { |
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.
Is there any annotation to mark this as internal api?
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.
No.
@@ -298,8 +332,14 @@ func dial(ctx context.Context, insecure bool, o *internal.DialSettings) (*grpc.C | |||
if err != nil { | |||
return nil, err | |||
} | |||
|
|||
ts := creds.TokenSource |
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.
This code will not be hit if the new auth lib is enabled. That that intentional here?
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.
Yes
Internal bug : b/372244283
This is being used in Bigtable client
googleapis/google-cloud-go#11066