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

Handle RecordTooLargeException #191

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kafka_test_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ else
fi

echo "Downloading Kafka version $KAFKA_VERSION"
curl -s -o kafka.tgz "http://ftp.wayne.edu/apache/kafka/$KAFKA_VERSION/kafka_2.11-$KAFKA_VERSION.tgz"
curl -s -o kafka.tgz "https://archive.apache.org/dist/kafka/$KAFKA_VERSION/kafka_2.11-$KAFKA_VERSION.tgz"
mkdir kafka && tar xzf kafka.tgz -C kafka --strip-components 1

echo "Starting ZooKeeper"
Expand Down
3 changes: 3 additions & 0 deletions lib/logstash/outputs/kafka.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ def retrying_send(batch)
rescue org.apache.kafka.common.errors.InterruptException => e
failures << record
nil
rescue org.apache.kafka.common.errors.RecordTooLargeException => e
Copy link

@praseodym praseodym Jun 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KafkaProducer::send cannot throw a RecordTooLargeException, so this PR does not make sense.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a Runtime exception that is unchecked

Copy link

@praseodym praseodym Jun 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect it to be thrown from the future.get() call a little down the code. Either way this PR does not help because the same (by default infinite) retry logic is still there; #193 proposes a better solution by only retrying sending events when a RetriableException is thrown.

failures << record
nil
rescue org.apache.kafka.common.errors.SerializationException => e
# TODO(sissel): Retrying will fail because the data itself has a problem serializing.
# TODO(sissel): Let's add DLQ here.
Expand Down