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

SpringDelegatingLambdaContainerHandler should reuse AsyncInitializationWrapper #758

Closed
deki opened this issue Jan 31, 2024 · 5 comments
Closed
Assignees

Comments

@deki
Copy link
Collaborator

deki commented Jan 31, 2024

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.

@olegz
Copy link
Collaborator

olegz commented May 15, 2024

The issue with it is that it will create circular dependency since s-c-function would need to depend on AWS code which depends on s-c-function.
Let me see if I can create some callback.
Overall I do agree that it should be the same code that uses async

@deki
Copy link
Collaborator Author

deki commented May 15, 2024

DId you take a look at #883? Already works well...

@olegz
Copy link
Collaborator

olegz commented May 15, 2024

Looking

@olegz
Copy link
Collaborator

olegz commented May 15, 2024

LGTM. That is what I was saying about the callback - SpringDelegatingInitHandler. So we can close this?

@deki
Copy link
Collaborator Author

deki commented May 16, 2024

Yes.

@deki deki closed this as completed May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants