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

Prevent runtime from crashing on defect (unchecked exception) and remove checked exception form lambda application signature. #203

Open
heaven-born opened this issue Apr 29, 2023 · 0 comments

Comments

@heaven-born
Copy link
Contributor

heaven-born commented Apr 29, 2023

  1. Currently, any defects that are not processed in the Lambda function code are passed to the runtime, causing it to crash. This results in AWS having to restart the runtime and reinitialize the entire application for the next event. Instead of this, I suggest logging the stack trace and returning an 'Internal Server Error' message without any additional information.

  2. Currently, all checked exceptions are returning an "Internal Server Error" message and a stack trace in the Lambda response. In most cases, we do not want to expose stack traces in the response. Therefore, I suggest removing the checked exception from the Lambda function signature. All checked exceptions must be processed inside the lambda function code.

P.S. It is worth mentioning, that for issue number 1 aws doesn't terminate the entire container, so technically the container is still warm on the next request. However, restarting the runtime with the app introduces extra expenses. The AWS logs say Error: Runtime exited with error: exit status 1 Runtime.ExitError on such crushes.

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

1 participant