Skip to content

impl(auth): add retries for universe_domain endpoint on MDS client#5310

Merged
alvarowolfx merged 12 commits intogoogleapis:mainfrom
alvarowolfx:impl-auth-mds-client-retry
Apr 14, 2026
Merged

impl(auth): add retries for universe_domain endpoint on MDS client#5310
alvarowolfx merged 12 commits intogoogleapis:mainfrom
alvarowolfx:impl-auth-mds-client-retry

Conversation

@alvarowolfx
Copy link
Copy Markdown
Contributor

Towards #3646

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.57%. Comparing base (e25c0cd) to head (bdacfe7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5310   +/-   ##
=======================================
  Coverage   97.57%   97.57%           
=======================================
  Files         222      222           
  Lines       47320    47419   +99     
=======================================
+ Hits        46172    46271   +99     
  Misses       1148     1148           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alvarowolfx alvarowolfx marked this pull request as ready for review April 7, 2026 17:04
@alvarowolfx alvarowolfx requested review from a team as code owners April 7, 2026 17:04
Comment thread src/auth/src/mds/client.rs Outdated
Comment thread src/auth/src/mds/client.rs Outdated
Comment thread src/auth/src/mds/client.rs Outdated
@alvarowolfx alvarowolfx marked this pull request as draft April 9, 2026 17:46
@alvarowolfx
Copy link
Copy Markdown
Contributor Author

Split from_gax_error method into PR #5350

@alvarowolfx alvarowolfx marked this pull request as ready for review April 13, 2026 15:15
@alvarowolfx alvarowolfx requested a review from dbolduc April 13, 2026 15:15
Copy link
Copy Markdown
Member

@dbolduc dbolduc left a comment

Choose a reason for hiding this comment

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

just nits, which I think are improvements, but you can decide if they are worth your time or not.

Comment thread src/auth/src/mds/client.rs Outdated
Comment on lines +185 to +186
backoff_policy: ExponentialBackoff::default().into(),
retry_throttler: Arc::new(Mutex::new(AdaptiveThrottler::default())),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: we are allocating these on every call to send(). We only need to do it once per MDS client.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But we would need multiple MDS Clients on the MDS Credential, because some calls (access_token, id_token) should not have retries and universe_domain needs retries. That's why the retry is allocated per call.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why can't you store the backoff_policy and retry_throttler on the client and clone that for each send()? You are currently making new ones for every send() call, right? Am I missing something?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think I got what you're saying, we are cloning Client anyway, so would make sense for the retry to live in the Client and be cloned from it and self contained, since the send() methods belongs to Client

Comment thread src/auth/src/mds/client.rs Outdated
Comment thread src/auth/src/mds/client.rs Outdated
Comment thread src/auth/src/mds/client.rs Outdated
Comment thread src/auth/src/mds/client.rs
@alvarowolfx alvarowolfx merged commit 89715ce into googleapis:main Apr 14, 2026
35 checks passed
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