Skip to content

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

@heaven-born

Description

@heaven-born
  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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions