Should Kafka Source Connector itsself after unrecoverable error? #19880
|
This is concerning the pulsar-io/kafka-source. Before I create an issue regarding this topic I would like to have some insight if the current behaviour is actually wrong or if there are already config values to adress this. We recently had an issue that caused the consumer in a kafka source connector to get kicked out of kafkas consumer group. The connector is running as a pod inside of kubernetes. The consumer is unrecoverable at that point so the source connector should have two options
However I feel like the connector just sitting there not consuming messages from kafka anymore is the wrong behaviour. Am I missing a config value? Would be happy to get your opinion on that and gladly create an issue as well if necessary |
Replies: 6 comments 8 replies
In the Kubernetes runtime, It should be this behavior.
In pulsar-io-framework, if a connector throws an exception, it will trigger this process exit. So, maybe the Kafka source connector does not throw an exception on your case. My guess is the logic handled here: I found a way to compare hacks to get the connector to throw exceptions. Maybe you can give it a try: set your Can you share the logs of your Kafka source connector? Maybe we can optimize for this scenario(let it throw an exception to trigger connector process exit). |
|
Thanks for the answer. I think that mitigation is an option for the kafka sink connector no? In the Kafka source connector you should have a Kafka Consumer and a Pulsar Producer. In our case the failing thread was the Kafka Consumer though. Since a Consumer that has been removed from the consumer group cannot be recovered I'd interpret the current behaviour as a bug then no? The consumer in that case should either be recreated or the process should exit. |
|
I think the root cause is here: Did you see some messages like I think this could be considered a bug. We need to fail the connector if there are any unexpected errors. |
|
@htbmw Could you provide a thread dump? |
Kafka Source Thread is trying to join it self. |
|
Thanks for the contributions here. |
I think the root cause is here:
pulsar/pulsar-io/kafka/src/main/java/org/apache/pulsar/io/kafka/KafkaAbstractSource.java
Lines 191 to 192 in 1c813fd
Did you see some messages like
Error while consuming recordsin the connector log? The Kafka source connector will print these exceptions but not exit the current process.I think this could be considered a bug. We need to fail the connector if there are any unexpected errors.