Skip to content
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

[bearertokenauthextension] Load token lazily for gRPC AUTH to fix token refresh issue #36749

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ms-hujia
Copy link

Description

For the gRPC client AUTH part of bearertokenauthextension, there's a token refresh issue which causes all telemetry rejected by server after a period of time. The old token is always used even if the token is refreshed in filesystem. The root cause is the token value is cached during the PerRPCCredentials() instead of retrieving the latest. This PR aims to fix it by loading the token lazily in GetRequestMetadata().

Link to tracking issue

N/A.

Testing

After I built a new docker image with this fix and tested in my environment, the token refresh issue didn't happen again after the first token expired.

Documentation

N/A.

Copy link
Member

@frzifus frzifus left a comment

Choose a reason for hiding this comment

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

Thanks!

@frzifus
Copy link
Member

frzifus commented Dec 10, 2024

@ms-hujia seems we miss a changelog entry.

You can run make chlog-new locally. This will create a file in .chloggen used to generate the changelogs for the next release. When filling the template you can re-use 36749 (number of your pr) as issue number.

@ms-hujia
Copy link
Author

@ms-hujia seems we miss a changelog entry.

You can run make chlog-new locally. This will create a file in .chloggen used to generate the changelogs for the next release. When filling the template you can re-use 36749 (number of your pr) as issue number.

Hi @frzifus, I've added the changelog and rebased with main. Could you help to merge this PR?

@ms-hujia
Copy link
Author

Hi @jpkrohling and @frzifus, thanks for your review! I'm wondering when this fix could be merged and appear in the release.

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

Successfully merging this pull request may close these issues.

4 participants