-
Notifications
You must be signed in to change notification settings - Fork 13
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
Sync mode should stop task when Lambda function fails #35
Comments
Here's some log output as well:
so the request itself is successful and returns a 200 response as it should, while the function was failing. What about a new property, e.g |
The response payload is non deterministic. |
I believe the response is deterministic. Just that upon function errors, it gets some little extra in the payload. I'm not sure about the low levels of the aws client even though I added logs about it :) So one has to examine the response payload. That's the only indication it sends. Luckily it is already available in the InvocationResponse: https://github.com/Nordstrom/kafka-connect-lambda/blob/master/src/main/java/com/nordstrom/kafka/connect/lambda/LambdaSinkTask.java#L205 which got it from here: https://github.com/Nordstrom/kafka-connect-lambda/blob/master/src/main/java/com/nordstrom/kafka/connect/lambda/InvocationClient.java#L63 |
I made some code that should take care of this case: #36 |
Thanks, @RickardCardell. This document is tells us that Lambda's signal for a function error is the header https://docs.aws.amazon.com/lambda/latest/dg/invocation-retries.html |
Hi I'm not fully sure what you imply so I may have understood.
So it should be a JSON according to the spec. The code I added also just UTF-8 encodes it. |
Any Lambda can return a JSON payload with these fields. The signal from AWS that it's actually an error is in the response header. |
Okay, I think I see what you mean. Here's where it is accessed in the connector: https://github.com/Nordstrom/kafka-connect-lambda/blob/master/src/main/java/com/nordstrom/kafka/connect/lambda/InvocationClient.java#L63 |
Aha! Thank you for being patient with me. @SgtPepperLHCB or I can carry on any other discussion items in the PR. |
Great! That PR is mostly for proof of concept. I.e that is one way of solving it, so I don't mind if it is completely rewritten or thrown away :) |
Thanks for a nice plugin!
When using sync mode and the invocation succeeds the response is seen as success even though the Lambda execution failed.
As long as the invocation succeeds, i.e the Lambda system could receive the event, the task just keep going, even though the actual Lambda function is throwing errors.
As I see it, the expected behaviour when the Lambda function fails and when using sync mode is to stop the task altogether so that no more messages are consumed from Kafka. Or at least have it as an option.
//Rickard
The text was updated successfully, but these errors were encountered: