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

Deactivate Vault Config Source refresh if running in non blocking thread #16021

Merged
merged 1 commit into from
Mar 26, 2021
Merged

Deactivate Vault Config Source refresh if running in non blocking thread #16021

merged 1 commit into from
Mar 26, 2021

Conversation

vsevel
Copy link
Contributor

@vsevel vsevel commented Mar 25, 2021

Fixes #15821
I am not sure we can do better at this point. This means this is a slight regression compared to the previous implementation with with okhttp, where we would block on the vault call in the vertx thread (which is not good), but at least functionally, we would be able to refresh the cache.
With the current implementation, we have to know that the vault config source cache refresh will only happen in non vertx threads. another approach would be to do the refresh from a timer, rather than doing it from the app thread. but this would require a dedicated thread. Ideally, it would be better to be able to register a callback on a central timer service.
In the meantime this fix will avoid the issue found in #15821

@vsevel vsevel requested a review from sberyozkin March 25, 2021 17:23
@sberyozkin
Copy link
Member

@vsevel Hi Vincent, I'm pretty sure you can run it using the blocking executor but some more Uni changes may have to be applied, CC @cescoffier

@cescoffier
Copy link
Member

@sberyozkin The issue here is that the method is synchronous (does not return a Uni). OF course, if it would return a Uni (as you did in the OIDC), then we would be able to use the same approach.

@sberyozkin
Copy link
Member

Hi @cescoffier, @vsevel sorry missed it.

Interesting problem, how to get ConfigSource run in the async mode - @vsevel, would you like to open an issue and CC to @radcortez ? May be Quarkus can have ConfigSource extension which uses Uni etc...

@sberyozkin sberyozkin merged commit 13c5469 into quarkusio:main Mar 26, 2021
@quarkus-bot quarkus-bot bot added this to the 1.14 - main milestone Mar 26, 2021
@sberyozkin
Copy link
Member

Forgot to add the approval but Clement's approval was enough for sure

@vsevel vsevel deleted the vault_vertx_illegal_state branch March 26, 2021 12:59
@vsevel
Copy link
Contributor Author

vsevel commented Mar 26, 2021

Interesting problem, how to get ConfigSource run in the async mode - @vsevel, would you like to open an issue and CC to @radcortez ? May be Quarkus can have ConfigSource extension which uses Uni etc...

here it is @sberyozkin #16058

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.

Quarkus Vault problem
4 participants