-
Notifications
You must be signed in to change notification settings - Fork 125
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
can't force lambda failure for non http events #537
Comments
No, returning non 200 response won't cause the Lambda invoke to fail. You need to throw an exception to crash the runtime. |
That works thanks! However it was not trivial to make it work with some languages like php with laravel for example. Just throwing an exception will be automatically handled in some cases and converted to a 500 http error. Even if you manage to get the php process to throw the exception anyway and kill the process, it's not the one that runs the environment really as you need an http server. The only way to do that was to locate the main parent process id and to do a pkill on it and wait, as if anything is returned before the parent process is killed it might not fail. Hopefully there will be sth added in the future to simplify the flow via a response header or/and http status code. |
I got your problem now. We could improve this for non-http event sources. |
Hey guys, I have a trigger setup for kafka events - aws:kafka. When I return any non 200 response back from my \events endpoint it treats the execution as a success. That would prevent the automatic aws retry mechanism to kick in and will result in missed unprocessed messages.
Is there a way to return a response that would result in a lambda failure?
The text was updated successfully, but these errors were encountered: