-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG] "java.lang.IllegalStateException: block()/blockFirst()/blockLast() are blocking" when attempting to refresh Application Configuration settings #35845
Comments
Hi @aleksanderKopec thank you for posting this detailed issue. @mssfang will follow up with you shortly! |
@mrm9084 Can you have a look at this? It is from spring-cloud-azure-appconfiguration-config AppConfigurationRefresh |
Hello, any updates on this? It's not super high priority for now, but I would like to know if I should find some workaround. |
@aleksanderKopec, I have been unable to replicate the issue. I'm still trying too. If you had a sample that did it, it would help identify the issue. |
Ok. Was able to replicate this. A few things.
This is caused by the background process still running when you return already. This could work around for now, will look to see if there is a better long term fix. |
Thanks for the response. I've tried multiple ways of adding
Some other things which I tried included running something akin to this:
or this
None of the code listed before worked. I've managed to make it work though, with this code:
I have no idea why this works, and the one in third code block doesn't, from my understanding they should be the same. But it seems the issue is that in other configurations the actual refresh is run on the default So yeah, the workaround works for our use-case, does exactly what I expect it to do, so I guess the issue could be closed if you prefer to. But I'm pretty sure it's still a valid bug, especially the third code block seems like something that should work. |
@aleksanderKopec, I agree it is a bug. I was able to replicate the error, and just any block fixed it for me. What annotation are you using on the class, it may effect it. |
These are all annotations I use on the Controller
|
Describe the bug
When attempting to refresh the configuration values using AppConfigurationRefresh, we are getting an exception because of an .block() in the configuration refresh code.
Exception or Stack Trace
To Reproduce
Steps to reproduce the behavior:
Run
AppConfigurationRefresh.refreshConfigurations()
when the refresh interval has passed (so the actual refresh is run).Code Snippet
Expected behavior
The configuration values should refreshed and no exception should be thrown.
Setup (please complete the following information):
Additional context
We are getting some relevant warnings before the exception is thrown
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: