forked from apache/kafka
-
Notifications
You must be signed in to change notification settings - Fork 0
KAFKA-17871: avoid blocking the herder thread when producer flushing hangs #21
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
Closed
Closed
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
8fa0d97
MINOR: Fix typo in ApiKeyVersionsProvider exception message (#19521)
apalan60 7710d1c
KAFKA-14487: Move LogManager static methods/fields to storage module …
mimaison a04c2fe
KAFKA-19180 Fix the hanging testPendingTaskSize (#19526)
Yunyung ae771d7
KAFKA-8830 make Record Headers available in onAcknowledgement (#17099)
rich-c-shop 18584b1
MINOR: ignore null judgement in LogCleaner (#19524)
gongxuanzhang a8f4999
KAFKA-19019: Add support for remote storage fetch for share groups (#…
adixitconfluent 4410d35
KAFKA-19179: remove the dot from thread_dump_url (#19525)
gongxuanzhang 070892d
MINOR: redundant gradle expression is removed (#19200)
dejan2609 11904c7
KAFKA-19166: Fix RC tag in release script (#19518)
mumrah 66147d5
KAFKA-19057: Stabilize KIP-932 RPCs for AK 4.1 (#19378)
AndrewJSchofield 22c5794
KAFKA-19159: Removed time based evictions for share sessions (#19500)
chirag-wadhwa5 e78e106
MINOR: Improve javadoc for share consumer (#19533)
AndrewJSchofield 5af3547
KAFKA-18572: Update Kafka Streams metric documenation (#18673)
ukpagrace b97a130
KAFKA-16538; Enable upgrading kraft version for existing clusters (#1…
jsancio 71d0878
KAFKA-14690; Add TopicId to OffsetCommit API (#19461)
dajac b088ba7
KAFKA-19181: removed assertions in test_share_multiple_partitions as …
chirag-wadhwa5 4335027
KAFKA-19156: Streamlined share group configs, with usage in ShareSess…
chirag-wadhwa5 6fe1598
KAFKA-18170: Add scheduled job to snapshot cold share partitions. (#1…
smjn efd7852
KAFKA-19124: Follow up on code improvements (#19453)
cadonna 8b4560e
KAFKA-15767 Refactor TransactionManager to avoid use of ThreadLocal (…
kirktrue 3fae785
KAFKA-19110: Add missing unit test for Streams-consumer integration (…
FrankYang0529 f0f5571
MINOR: Change KIP-932 log messages from early access to preview (#19547)
AndrewJSchofield f4ab3a2
MINOR: Use readable interface to parse response (#19353)
soondenana 039ba5e
MINOR: Improve member epoch mismatch logging for share groups (#19549)
AndrewJSchofield 3c05dfd
KAFKA-18889: Make records in ShareFetchResponse non-nullable (#19536)
apoorvmittal10 62fe528
KAFKA-19082: [1/4] Add client config for enable2PC and overloaded ini…
rreddy-22 d6133f6
KAFKA-18988: Connect Multiversion Support (Updates to status and metr…
snehashisp a948537
MINOR: Small refactor in group coordinator (#19551)
dajac 22b89b6
KAFKA-19192; Old bootstrap checkpoint files cause problems updated se…
cmccabe 36d2498
MINOR: Use meaningful name in AsyncKafkaConsumerTest (#19550)
FrankYang0529 ee4debb
KAFKA-19128: Kafka Streams should not get offsets when close dirty (#…
aliehsaeedii e79f5f0
KAFKA-19195: Only send the right group ID subset to each GC shard (#1…
lucasbru 2ce7c44
KAFKA-19198: Resolve NPE when topic assigned in share group is delete…
AndrewJSchofield 732ed06
KAFKA-19190: Handle shutdown application correctly (#19544)
lucasbru 369cc56
KAFKA-17747: [1/N] Add MetadataHash field to Consumer/Share/StreamGro…
FrankYang0529 0979bb5
KAFKA-17871: avoid blocking the herder thread when producer flushing …
davide-armand 5d8f00c
KAFKA-17871: fixup tests
davide-armand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -186,7 +186,7 @@ public class AsyncKafkaConsumer<K, V> implements ConsumerDelegate<K, V> { | |
| */ | ||
| private class BackgroundEventProcessor implements EventProcessor<BackgroundEvent> { | ||
|
|
||
| private Optional<StreamsRebalanceListener> streamsGroupRebalanceCallbacks = Optional.empty(); | ||
| private Optional<StreamsRebalanceListener> streamsRebalanceListener = Optional.empty(); | ||
| private final Optional<StreamsRebalanceData> streamsRebalanceData; | ||
|
|
||
| public BackgroundEventProcessor() { | ||
|
|
@@ -202,7 +202,7 @@ private void setStreamsRebalanceListener(final StreamsRebalanceListener streamsR | |
| throw new IllegalStateException("Background event processor was not created to be used with Streams " + | ||
| "rebalance protocol events"); | ||
| } | ||
| this.streamsGroupRebalanceCallbacks = Optional.of(streamsRebalanceListener); | ||
| this.streamsRebalanceListener = Optional.of(streamsRebalanceListener); | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -277,20 +277,15 @@ private void processStreamsOnAllTasksLostCallbackNeededEvent(final StreamsOnAllT | |
|
|
||
| private StreamsOnTasksRevokedCallbackCompletedEvent invokeOnTasksRevokedCallback(final Set<StreamsRebalanceData.TaskId> activeTasksToRevoke, | ||
| final CompletableFuture<Void> future) { | ||
| final Optional<KafkaException> error; | ||
| final Optional<Exception> exceptionFromCallback = streamsGroupRebalanceCallbacks().onTasksRevoked(activeTasksToRevoke); | ||
| if (exceptionFromCallback.isPresent()) { | ||
| error = Optional.of(ConsumerUtils.maybeWrapAsKafkaException(exceptionFromCallback.get(), "Task revocation callback throws an error")); | ||
| } else { | ||
| error = Optional.empty(); | ||
| } | ||
| final Optional<Exception> exceptionFromCallback = streamsRebalanceListener().onTasksRevoked(activeTasksToRevoke); | ||
| final Optional<KafkaException> error = exceptionFromCallback.map(e -> ConsumerUtils.maybeWrapAsKafkaException(e, "Task revocation callback throws an error")); | ||
| return new StreamsOnTasksRevokedCallbackCompletedEvent(future, error); | ||
| } | ||
|
|
||
| private StreamsOnTasksAssignedCallbackCompletedEvent invokeOnTasksAssignedCallback(final StreamsRebalanceData.Assignment assignment, | ||
| final CompletableFuture<Void> future) { | ||
| final Optional<KafkaException> error; | ||
| final Optional<Exception> exceptionFromCallback = streamsGroupRebalanceCallbacks().onTasksAssigned(assignment); | ||
| final Optional<Exception> exceptionFromCallback = streamsRebalanceListener().onTasksAssigned(assignment); | ||
| if (exceptionFromCallback.isPresent()) { | ||
| error = Optional.of(ConsumerUtils.maybeWrapAsKafkaException(exceptionFromCallback.get(), "Task assignment callback throws an error")); | ||
| } else { | ||
|
|
@@ -302,7 +297,7 @@ private StreamsOnTasksAssignedCallbackCompletedEvent invokeOnTasksAssignedCallba | |
|
|
||
| private StreamsOnAllTasksLostCallbackCompletedEvent invokeOnAllTasksLostCallback(final CompletableFuture<Void> future) { | ||
| final Optional<KafkaException> error; | ||
| final Optional<Exception> exceptionFromCallback = streamsGroupRebalanceCallbacks().onAllTasksLost(); | ||
| final Optional<Exception> exceptionFromCallback = streamsRebalanceListener().onAllTasksLost(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to For example: final Optional<Exception> exceptionFromCallback = streamsRebalanceListener().onAllTasksLost();
final Optional<KafkaException> error = exceptionFromCallback.map(e -> ConsumerUtils.maybeWrapAsKafkaException(e, "All tasks lost callback throws an error"));
return new StreamsOnAllTasksLostCallbackCompletedEvent(future, error); |
||
| if (exceptionFromCallback.isPresent()) { | ||
| error = Optional.of(ConsumerUtils.maybeWrapAsKafkaException(exceptionFromCallback.get(), "All tasks lost callback throws an error")); | ||
| } else { | ||
|
|
@@ -318,8 +313,8 @@ private StreamsRebalanceData streamsRebalanceData() { | |
| "rebalance protocol events")); | ||
| } | ||
|
|
||
| private StreamsRebalanceListener streamsGroupRebalanceCallbacks() { | ||
| return streamsGroupRebalanceCallbacks.orElseThrow( | ||
| private StreamsRebalanceListener streamsRebalanceListener() { | ||
| return streamsRebalanceListener.orElseThrow( | ||
| () -> new IllegalStateException("Background event processor was not created to be used with Streams " + | ||
| "rebalance protocol events")); | ||
| } | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with
invokeOnTasksRevokedCallback, this method could also be refactored to useOptional.mapto simplify the logic for handling the optional exception. This would make the code more concise and uniform across similar methods in this class.For example: