out_rdkafka2: Apply unrecoverable_error_codes to delivery report errors - #579
Merged
kenhys merged 2 commits intoSep 2, 2026
Merged
Conversation
- The list was only checked when producer.produce raised synchronously, so the same code reported through handler.wait was re-raised as is and the chunk kept being retried even for the default msg_size_too_large - Check the code once in write's rescue so both paths raise Fluent::UnrecoverableError, with discard_kafka_delivery_failed still taking precedence - Let unknown_topic and unknown_partition reach the check so listing them in unrecoverable_error_codes takes effect - Match Rdkafka::RdkafkaError instead of any exception answering #code, since the rescue now spans the whole write body - Document the parameter in README, including how a code is spelled Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
kenhys
requested changes
Sep 2, 2026
Co-authored-by: Kentaro Hayashi <kenhys@gmail.com> Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Watson1978
force-pushed
the
rdkafka2-unrecoverable-delivery-errors
branch
from
September 2, 2026 07:03
c6d32a0 to
72725d6
Compare
kenhys
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
unrecoverable_error_codeswas only checked insideenqueue_with_retry, so it applied whenproducer.produceraised but not when the same code came back through the delivery report. With the default settings an oversized message rejected by the broker was re-raised as a plainRdkafka::RdkafkaErrorand the chunk was retried untilretry_timeoutexpired.Note for existing users: on the delivery report path the default codes now divert the chunk to the secondary output or to the backup directory instead of retrying it. This is what the parameter already did on the produce path since #510. Setting
unrecoverable_error_codesto an empty value retries every error.