serverless-java-container icon indicating copy to clipboard operation
serverless-java-container copied to clipboard

SpringDelegatingLambdaContainerHandler should reuse AsyncInitializationWrapper

Open deki opened this issue 5 months ago • 0 comments

Lambda has max. 10 seconds for init which is handled in https://github.com/spring-cloud/spring-cloud-function/blob/14160f8201424d532c7e19e83853ac87ccc0f829/spring-cloud-function-adapters/spring-cloud-function-serverless-web/src/main/java/org/springframework/cloud/function/serverless/web/ServerlessMVC.java#L109. Currently if the init e.g. takes 15 seconds, the initial request fails while it works for the other older handlers.

Let's reuse AsyncInitializationWrapper and remove the thread from ServerlessMVC. I already introduced a minimal InitializableLambdaContainerHandler interface so it's easier to reuse it.

deki avatar Jan 31 '24 14:01 deki