Skip to content

Commit 42c6c22

Browse files
committed
bugfix
Signed-off-by: Bing Wang <[email protected]>
1 parent f799f61 commit 42c6c22

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/fluent/plugin/kafka_producer_ext.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,8 @@ def assign_partitions!
254254

255255
@pending_message_queue.each do |message|
256256
partition = message.partition
257-
257+
partition_count = @cluster.partitions_for(message.topic).count
258258
begin
259-
partition_count = @cluster.partitions_for(message.topic).count
260259

261260
if partition.nil?
262261
partition = @partitioner.call(partition_count, message)

lib/fluent/plugin/out_kafka2.rb

+1
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ def write(chunk)
403403
rescue Kafka::UnknownTopicOrPartition
404404
if @use_default_for_unknown_topic && topic != @default_topic
405405
log.warn "'#{topic}' topic not found. Retry with '#{default_topic}' topic"
406+
producer.clear_buffer
406407
topic = @default_topic
407408
retry
408409
end

0 commit comments

Comments
 (0)