Skip to content

Conversation

lianetm
Copy link
Member

@lianetm lianetm commented Sep 3, 2025

Add to the consumer.close java doc to describe the error handling
behaviour.

Reviewers: Matthias J. Sax [email protected], Chia-Ping Tsai
[email protected], Andrew Schofield [email protected],
TengYao Chi [email protected]

Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

@lianetm thanks for this improvement !

@@ -1833,6 +1838,9 @@ public void close(Duration timeout) {
* {@link ConsumerConfig#REQUEST_TIMEOUT_MS_CONFIG} for these requests to complete during the close operation.
* Note that the execution time of callbacks (such as {@link OffsetCommitCallback} and
* {@link ConsumerRebalanceListener}) does not consume time from the close timeout.
* <p>
* This close operation will attempt all shutdown steps even if one of them fails.
* It logs all encountered errors, continues to execute the next steps, and finally throws the first error found.
Copy link
Member

Choose a reason for hiding this comment

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

Should we also list the exceptions, as we do for other close methods?

Copy link
Contributor

@frankvicky frankvicky Sep 4, 2025

Choose a reason for hiding this comment

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

+1, makes sense to me to align these comments.

Copy link
Member

@AndrewJSchofield AndrewJSchofield left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. For KafkaConsumer, the changes look good subject to the comment already left. Please could you apply the same change to KafkaShareConsumer.

@lianetm
Copy link
Member Author

lianetm commented Sep 5, 2025

Thank you all for the reviews. Comments addressed adding missing exceptions to the KafkaConsumer (and checked the ShareKafkaConsumer has them already consistently).

@AndrewJSchofield
Copy link
Member

@lianetm Checkstyle :)

Copy link
Contributor

@frankvicky frankvicky left a comment

Choose a reason for hiding this comment

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

Thanks for the doc improvement

@chia7712
Copy link
Member

chia7712 commented Sep 5, 2025

the root cause of flaky is https://github.com/apache/kafka/pull/20244/files#r2325557949

@chia7712 chia7712 merged commit 5fefb16 into apache:trunk Sep 5, 2025
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants