Azure-sdk-for-java: Spring Boot 2.4.2 and Azure SDK (Azure Storage Blob and Queue) - Application does not start anymore

Created on 27 Jan 2021  路  6Comments  路  Source: Azure/azure-sdk-for-java

Query/Question
We are using the azure sdk for java to interact with the azure storage account (blob and store). We are currently upgrading our backend services to spring boot 2.4.2. and it seems that the async tasks in the library are no longer executed. The application does not start, it simply stops on any interaction with the blob client or queue client (or times out, if we set a timeout). We have a feeling, that there are no reactor threads to pick-up the async part. Any idea what is happening here?

Why is this not a Bug or a feature Request?
We do not know if this is bug or an incompatability or wrong usage.

Setup (please complete the following information if applicable):
Spring Boot 2.4.2 and various starters
com.azure:azure-storage-blob:12.10.0
com.azure:azure-storage-queue:12.8.0

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

  • [x] Query Added
  • [x] Setup information Added
Client customer-reported dependency-issue question

All 6 comments

Hi @larsduelfer, thank you for submitting this issue.

There are known dependency mismatches between Spring Framework 2.4.x and the latest releases of the Azure SDK libraries. Spring Framework upgraded to a new major version of Reactor Netty (1.0.x) which is incompatible with the version that the Azure SDK libraries use (0.9.x). This may be the cause for the SDKs no longer working.

We are currently working on upgrading our dependency to 1.0.x as well. I'll update this as we progress on our upgrade.

Hi @alzimmermsft, do you already know how long it will take until the new version is released? Days? Weeks? Months?

Hi @alzimmermsft just some more informationen about our setup. We are NOT using the spring reactive stack (webflux), just the spring mvc stack. Therefore, without the azure library, we would not have any reactor dependencies. That is, what makes me wonder, if that is the root cause. Nevertheless, an upgrade of the dependencies to matcht the ones in spring boot 2.4.2 is much appreciated.

From debugging, we saw that the reactor thread factory is being called and a thread called "parallel-1" is started but there are no reactor epoll threads as there were before the upgrade. I am wondering, which component is responsible for starting those. Can you provide some insights?

Hi @alzimmermsft I am currently trying to pin the problematic spring library that causes the application start to fail in combination with the azure sdk on the classpath. So far, I see that this is happening as soon as the following lib is on the classpath:

org.springframework.data:spring-data-jpa

I am really struggling to understand, which library (spring or azure) is causing the problem. I highly appreciate any help from your side in this regard. Since everyhing worked fine with spring boot 2.3.x, I still have a feeling that something changed with spring boot (maybe in the autoconfiguration) that is causing this. The main thread is blocked by an await() statement and it seems as if the thread that the main thread is waiting for, does not release the main thread again by calling the appropriate countDown() method in the CountDownLatch that is handed over to the other thread.

UPDATE: The problem occurs if this auto configuration is active: JpaRepositoriesAutoConfiguration.class If I exclude it, the application starts. This is very strange and we need this configuration.

Hi @alzimmermsft, do you already know how long it will take until the new version is released? Days? Weeks? Months?

The current timeline is looking to fall in the middle, weeks, category. We've performed the upgrade process but are working on stabilizing our test runs and then will perform performance and stress testing validations before shipping.

@larsduelfer could you give a small code sample and POM configuration that I could use to help troubleshoot the issue further.

Hi @alzimmermsft, it took a while but here is now a link to a github repo with a demo app showing the issue on application start. In order to use it, you need to add a connection string to a mysql db (docker container, for example) and a connection string to an azurite container as well as the name of a "container" inside the emulated azure storage account. (see application.yml)

https://github.com/larsduelfer/azure-blob-store-issue

As is, the applications does not start. If you, for example, remove the @Component annotation from the BlobStorageHealthEndpoint class. The application will start. This was different before the sprint boot update where there was not issue with all beans contained in this repo.

It seems, that depending on the sequence how the beans are creates, the issue appears or does not appear.

Was this page helpful?
0 / 5 - 0 ratings