From 796f44beacd30ec8d300b483ab55193a2afeba7a Mon Sep 17 00:00:00 2001 From: Mingyu Chen Date: Thu, 12 Nov 2020 10:05:10 +0800 Subject: [PATCH] [Bug] Fix bug that routine load blocked with TOO_MANY_TASKS error (#4861) When receiving empty msg from kafka, the load process will quit abnormally. Fix #4860 --- be/src/runtime/routine_load/data_consumer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/be/src/runtime/routine_load/data_consumer.cpp b/be/src/runtime/routine_load/data_consumer.cpp index 32240f11b2..4b3954a27d 100644 --- a/be/src/runtime/routine_load/data_consumer.cpp +++ b/be/src/runtime/routine_load/data_consumer.cpp @@ -193,7 +193,11 @@ Status KafkaDataConsumer::group_consume( consumer_watch.stop(); switch (msg->err()) { case RdKafka::ERR_NO_ERROR: - if (!queue->blocking_put(msg.get())) { + if (msg->len() == 0) { + // ignore msg with length 0. + // put empty msg into queue will cause the load process shutting down. + break; + } else if (!queue->blocking_put(msg.get())) { // queue is shutdown done = true; } else {