spring-cloud-function icon indicating copy to clipboard operation
spring-cloud-function copied to clipboard

Azure Adopter re-initialize spring boot when we have several functions

Open TsuyoshiUshio opened this issue 6 years ago • 3 comments

Hello, guys,

I have a bug report https://github.com/Azure/azure-functions-host/issues/6719 . I investigate why it happens. I'd like to share it.

When we have more than one functions, once we send request to the other functions, it will re-initialize the spring boot.

To reproduce

  1. Create function1 and function2
  2. Start Azure Functions
  3. send request to function1 -> initialize the Spring Boot then execute function1
  4. send request to function1 -> execute function1
  5. send request to function2 -> initialize the Spring Boot then execute function2
  6. send request to function1 -> initialize the Spring Boot then execute function1

Possible Root Cause

In this logic, the AzureSpringBootRequestHandler has functionName. It compares if it is the same as the functionName and if not the same, it will initialize it.

https://github.com/spring-cloud/spring-cloud-function/blob/a7104e489ec1f608dc7229b9faad12ca6eedf460/spring-cloud-function-adapters/spring-cloud-function-adapter-azure/src/main/java/org/springframework/cloud/function/adapter/azure/AzureSpringBootRequestHandler.java#L81

Sample https://github.com/Azure/azure-functions-host/issues/6719#issuecomment-703119773

Related

https://github.com/spring-cloud/spring-cloud-function/issues/425

TsuyoshiUshio avatar Oct 27 '20 18:10 TsuyoshiUshio

I can confirm I had the same issue. Are there any possibility to have this fixed?

glauber-md avatar Dec 10 '20 02:12 glauber-md

I have the same problem. Are there any possibility to have this fixed?

Thanks

yentini avatar Feb 24 '21 10:02 yentini

We are facing the same problem,

Our clients are pushing us to solve this issue...

We are seeing an excessive increase in the times of the calls to the functions which prevents the migration of the application.

Is there any quick fix for this issue? or any update soon?

Thanks in advance!

RaulRubioBressel avatar Mar 02 '21 17:03 RaulRubioBressel