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

SIGTERM SignalException: Init error when loading handler #155

Open
metaskills opened this issue Apr 17, 2023 · 5 comments
Open

SIGTERM SignalException: Init error when loading handler #155

metaskills opened this issue Apr 17, 2023 · 5 comments

Comments

@metaskills
Copy link
Member

metaskills commented Apr 17, 2023

Been seeing these a lot more lately on the latest cookiecutter with Ubuntu image. Normally I would only see these on shutdown but I am starting to see them more on first invoke/init. Here is a screenshot of the stack trace. May fork or PR here. https://github.com/aws/aws-lambda-ruby-runtime-interface-client

Screenshot 2023-07-04 at 9 12 47 AM

@plukevdh
Copy link

Questions because I'm seeing this elsewhere as well, have seen very few reports of this from others, and I'm trying to narrow down causes:

  1. Does this only happen during startups of newly deployed code, i.e., did you deploy new code and then first invocations caused this error?
  2. Do you have any additional extensions loaded?

I wonder whether or not lambda gets caught terminating new inits along side old instances of the runtime by broadcasting SIGTERMs differently than before...

@metaskills
Copy link
Member Author

Does this only happen during startups

Yes, I think so. I have updated the image above to show a bit more of the completeness. Any log that has this SIGTERM... it is the ONLY thing in the log. So my assumption is that it is only during startup and the Lambda service bails on this function and starts another.

Do you have any additional extensions loaded?

Yup, these two:

I wonder whether or not lambda gets caught terminating new inits along side old instances of the runtime by broadcasting SIGTERMs differently than before...

"along side" 🤔

@metaskills
Copy link
Member Author

I'm gonna turn on these two env vars and monitor things.

LAMBDA_PUNCH_LOG_LEVEL: debug
CRYPTEIA_DEBUG: true

@plukevdh
Copy link

plukevdh commented Jul 5, 2023

"along side" meaning that a sigterm gets broadcast to terminate old lambdas running while the new lambdas are attempting to init and both old and new versions of the lambda get terminated and then the new version starts again. Just a theory. I'd need some kind of sha or other code version identifier to confirm that.

For us, we resolved by manually trapping the sigterm per the details suggested here. It feels like this is something the underlying RIC should handle, but at the same time, I can understand why signal handling may be something best left to the app code rather than the handler.

@metaskills
Copy link
Member Author

Thanks! Just learned about this today too:

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