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

Fail task upon function execution error #36

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

RickardCardell
Copy link

@RickardCardell RickardCardell commented May 29, 2020

Maybe this behaviour should be configurable, but this will at least not swallow any function execution error that occurs.

Based on aws doc

Fixes #35

Sample log output upon function exeution error:

connect_1          | [2020-05-29 09:30:46,649] ERROR WorkerSinkTask{id=example-lambda-connector-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted. (org.apache.kafka.connect.runtime.WorkerSinkTask)
connect_1          | com.nordstrom.kafka.connect.lambda.LambdaSinkTask$FunctionExecutionException: Lambda function execution failed. Reason: Unhandled: {"errorMessage": "SDSADSDDS", "errorType": "ValueError", "stackTrace": ["  File \"/var/task/lambda_function.py\", line 5, in lambda_handler\n    raise ValueError(\"SDSADSDDS\")\n"]}
connect_1          | 	at com.nordstrom.kafka.connect.lambda.LambdaSinkTask.handleResponse(LambdaSinkTask.java:215)
connect_1          | 	at com.nordstrom.kafka.connect.lambda.LambdaSinkTask.invoke(LambdaSinkTask.java:199)
connect_1          | 	at com.nordstrom.kafka.connect.lambda.LambdaSinkTask.put(LambdaSinkTask.java:86)
connect_1          | 	at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:538)
connect_1          | 	at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:321)
connect_1          | 	at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:224)
connect_1          | 	at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:192)
connect_1          | 	at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:177)
connect_1          | 	at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:227)
connect_1          | 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
connect_1          | 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
connect_1          | 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
connect_1          | 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
connect_1          | 	at java.lang.Thread.run(Thread.java:748)

@RickardCardell RickardCardell changed the title Fixes #35 - Fail task upon function execution error Fail task upon function execution error May 29, 2020
@RickardCardell RickardCardell marked this pull request as ready for review June 1, 2020 14:00
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

Successfully merging this pull request may close these issues.

Sync mode should stop task when Lambda function fails
1 participant