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

fix: Lazy load JWKS #9446

Merged
merged 4 commits into from
Jan 3, 2023
Merged

fix: Lazy load JWKS #9446

merged 4 commits into from
Jan 3, 2023

Conversation

flaneur2020
Copy link
Member

@flaneur2020 flaneur2020 commented Jan 3, 2023

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

I runs an integration tests environment which runs a jwks endpoint and databend-query, but in the environment, it's hard to keep the start up order between databend-query and the jwks endpoint.

When databend-query started eariler than the jwks endpoint, it'd panic on start up with the following error:

Databend Query start failure, cause: Code: 1051, displayText = Could not download JWKS: error sending request for url (https://jwks.xxx.svc:8080/.well-known/jwks.json): error trying to connect: dns error: no record found for Query { name: Name("jwks.xxx.svc."), query_type: AAAA, query_class: IN }.

This PR makes the following changes:

  • loading JWKS in a lazy manner, makes the JWKS endpoint not a hard requirement for the databend-query's start up
  • implement the interval polling JWKS logic in the todo
  • removes the async in try_create function and the related callers

@vercel
Copy link

vercel bot commented Jan 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) Jan 3, 2023 at 5:06AM (UTC)

@mergify mergify bot added the pr-bugfix this PR patches a bug in codebase label Jan 3, 2023
@flaneur2020 flaneur2020 marked this pull request as ready for review January 3, 2023 05:39
@flaneur2020
Copy link
Member Author

@Xuanwo plz help take a look?

@flaneur2020 flaneur2020 requested a review from Xuanwo January 3, 2023 05:39
Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Nice change!

@BohuTANG BohuTANG merged commit 664f240 into databendlabs:main Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants