[fix][io] Kafka Source connector maybe stuck#22511
Merged
shibd merged 2 commits intoapache:masterfrom Apr 16, 2024
Merged
Conversation
|
@shibd Please add the following content to your PR description and select a checkbox: |
lhotari
reviewed
Apr 15, 2024
lhotari
approved these changes
Apr 15, 2024
shibd
added a commit
that referenced
this pull request
Apr 16, 2024
(cherry picked from commit bbff29d)
shibd
added a commit
that referenced
this pull request
Apr 16, 2024
(cherry picked from commit bbff29d)
shibd
added a commit
that referenced
this pull request
Apr 16, 2024
(cherry picked from commit bbff29d)
shibd
added a commit
that referenced
this pull request
Apr 16, 2024
(cherry picked from commit bbff29d)
hanmz
pushed a commit
to hanmz/pulsar
that referenced
this pull request
Feb 12, 2025
3 tasks
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.
Motivation
The current implementation of Kafka source connector, that
KafkaRecorddoes not implement thefail()method.pulsar/pulsar-io/kafka/src/main/java/org/apache/pulsar/io/kafka/KafkaAbstractSource.java
Line 222 in bbae607
If
PulsarSinksend a message to pulsar failed, will callrecord.fail().pulsar/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/sink/PulsarSink.java
Lines 194 to 196 in 43a9898
But because KafkaRecord does not implement it, this
futureswill never end.pulsar/pulsar-io/kafka/src/main/java/org/apache/pulsar/io/kafka/KafkaAbstractSource.java
Line 178 in 495b141
This causes the Kafka consumer to leave the consumer group due to more than
max.poll.interval.ms.Modifications
fail()method forKakfaRecord.CompletableFuture.allOf(futures).get()support a timeout, set to 2/3 ofmax.poll.interval.ms. This adjustment is to ensure the interval between twopollrequests does not exceed Kafkamax.poll.interval.ms.Verifying this change
throwExceptionBySendFailandthrowExceptionBySendTimeOutto cover it.Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: