Aiven-Open/cloud-storage-connectors-for-apache-kafka

Improve error handling on misconfigured connectors

Open

#504 opened on Jul 31, 2025

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Java (37 forks)auto 404
enhancementgood first issue

Repository metrics

Stars
 (56 stars)
PR merge metrics
 (PR metrics pending)

Description

Intro

The log simply states that the polling thread has died. It should mention that there is probably an earlier entry in the log explaining what caused the shutdown.

Reported issue

When the s3 source connector fails on startup (due to a wrong config?), the exception thrown is very generic. The output looks as shown below. It would improve usability to make the exceptions thrown more explicit.

{
  "name": "s3-source-connector",
  "connector": {
    "state": "RUNNING",
    "worker_id": "kafka-connect:8083"
  },
  "tasks": [
    {
      "id": 0,
      "state": "FAILED",
      "worker_id": "kafka-connect:8083",
      "trace": "org.apache.kafka.connect.errors.ConnectException: io.aiven.kafka.connect.s3.source.S3SourceTask polling thread has died\n\tat io.aiven.kafka.connect.common.source.AbstractSourceTask.poll(AbstractSourceTask.java:224)\n\tat org.apache.kafka.connect.runtime.AbstractWorkerSourceTask.poll(AbstractWorkerSourceTask.java:462)\n\tat org.apache.kafka.connect.runtime.AbstractWorkerSourceTask.execute(AbstractWorkerSourceTask.java:351)\n\tat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:202)\n\tat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:257)\n\tat org.apache.kafka.connect.runtime.AbstractWorkerSourceTask.run(AbstractWorkerSourceTask.java:75)\n\tat org.apache.kafka.connect.runtime.isolation.Plugins.lambda$withClassLoader$1(Plugins.java:181)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base/java.lang.Thread.run(Thread.java:829)\n"
    }
  ],
  "type": "source"
}

Contributor guide