-
Notifications
You must be signed in to change notification settings - Fork 615
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
AWS Lambda - Repeated initialization sequence in log #1030
Comments
After a series of tests I figured out that I had another configuration problem and I am not certain the issue has something to do with the secrets manager/parameter store. |
Here is the debug output right when it re-initializes:
|
OK, I found the issue. AWSLambda the launcher that is used by AWS is creating 2 instances of org.springframework.cloud.function.adapter.aws.FunctionInvoker one without event name and one with the event name. |
I added the FUNCTION_INVOKER_LATE_INITIALIZATION flag. You can now set it to true in the AWS Environment and the initialisation will be deferred to first request |
Hi Oleg, is there any plans on fixing this another way, without defining an environment variable, or will this be the official solution going forward? |
I got my function deployed to AWS and it's running fine, but I'm worried about seeing the init sequence 2 times in the log (I have seen it 3 times when it fails) and long (probably double) boot up time:
I am using Cloud Function version 4.0.2 and boot version 3.0.5.
I think it has to do with me trying to import configuration from secrets manager and parameter store:
The app first starts up with the parameters provided in the properties file and get initialized later with the configuration from the secrets manager / parameter store.
I have some dummy values for the database configuration in the applications.properties. If I take those out the app will fail initializing, as a matter of fact it will fail twice.
I will try reproducing the problem locally and post an update in here.
The text was updated successfully, but these errors were encountered: