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

CloudFormation wrapper should recover from panics #172

Closed
aidansteele opened this issue Feb 25, 2019 · 1 comment
Closed

CloudFormation wrapper should recover from panics #172

aidansteele opened this issue Feb 25, 2019 · 1 comment

Comments

@aidansteele
Copy link
Contributor

type CustomResourceLambdaFunction func(context.Context, Event) (reason string, err error)

If a CustomResourceLambdaFunction (definition above) panics, it is recovered from in the generic Lambda handling below:

if err := recover(); err != nil {
panicInfo := getPanicInfo(err)
response.Error = &messages.InvokeResponse_Error{
Message: panicInfo.Message,
Type: getErrorType(err),
StackTrace: panicInfo.StackTrace,
ShouldExit: true,
}
}

This will cause stack creations/updates to hang for a long time, as CloudFormation has a very long timeout waiting for a response. It would be a significant improvement if the custom resource wrapper recovered from panics and sent the error to the CloudFormation service.

Is this something you would be open to? I would be happy to submit a PR for review if you are ok with the idea.

@bmoffatt
Copy link
Collaborator

Sounds like a good idea to me!

aidansteele added a commit to aidansteele/aws-lambda-go that referenced this issue Mar 9, 2019
Panics are not recovered, as this would cause the stacktrace to be lost by
handlers higher in the stack that are yet to be unwound.
aidansteele added a commit to aidansteele/aws-lambda-go that referenced this issue Mar 9, 2019
Panics are not recovered, as this would cause the stacktrace to be lost by
handlers higher in the stack that are yet to be unwound.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants