You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "jack2012aa (via GitHub)" <gi...@apache.org> on 2025/11/25 00:35:57 UTC
[PR] KAFKA-19249: Replace Consumer#close(Duration) with Consumer#close(CloseOptions) [kafka]
jack2012aa opened a new pull request, #20983:
URL: https://github.com/apache/kafka/pull/20983
# Description
`Consumer#close(Duration)` was deprecated since 4.1. Replaced calls with `Consumer#close(CloseOptions)`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19249: Replace Consumer#close(Duration) with Consumer#close(CloseOptions) [kafka]
Posted by "jack2012aa (via GitHub)" <gi...@apache.org>.
jack2012aa commented on code in PR #20983:
URL: https://github.com/apache/kafka/pull/20983#discussion_r2558363831
##########
core/src/test/scala/integration/kafka/server/DynamicBrokerReconfigurationTest.scala:
##########
@@ -171,7 +171,7 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
clientThreads.foreach(_.join(5 * 1000))
executors.foreach(_.shutdownNow())
producers.foreach(_.close(Duration.ZERO))
- consumers.foreach(_.close(Duration.ofMillis(0)))
+ consumers.foreach(_.close(CloseOptions.timeout(Duration.ofMillis(0))))
Review Comment:
Thanks for the review! It is now fixed in the new version.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19249: Replace Consumer#close(Duration) with Consumer#close(CloseOptions) [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #20983:
URL: https://github.com/apache/kafka/pull/20983#discussion_r2560255318
##########
core/src/test/scala/integration/kafka/api/IntegrationTestHarness.scala:
##########
@@ -307,13 +307,14 @@ abstract class IntegrationTestHarness extends KafkaServerTestHarness {
@AfterEach
override def tearDown(): Unit = {
try {
+ val closeOptions = CloseOptions.timeout(Duration.ZERO)
producers.foreach(_.close(Duration.ZERO))
consumers.foreach(_.wakeup())
- consumers.foreach(_.close(Duration.ZERO))
+ consumers.foreach(_.close(closeOptions))
Review Comment:
nit: Since `closeOptions` is a mutable object, it would be better not to reuse it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19249: Replace Consumer#close(Duration) with Consumer#close(CloseOptions) [kafka]
Posted by "kirktrue (via GitHub)" <gi...@apache.org>.
kirktrue commented on code in PR #20983:
URL: https://github.com/apache/kafka/pull/20983#discussion_r2558182900
##########
core/src/test/scala/integration/kafka/server/DynamicBrokerReconfigurationTest.scala:
##########
@@ -171,7 +171,7 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
clientThreads.foreach(_.join(5 * 1000))
executors.foreach(_.shutdownNow())
producers.foreach(_.close(Duration.ZERO))
- consumers.foreach(_.close(Duration.ofMillis(0)))
+ consumers.foreach(_.close(CloseOptions.timeout(Duration.ofMillis(0))))
Review Comment:
```suggestion
consumers.foreach(_.close(CloseOptions.timeout(Duration.ZERO)))
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19249: Replace Consumer#close(Duration) with Consumer#close(CloseOptions) [kafka]
Posted by "AndrewJSchofield (via GitHub)" <gi...@apache.org>.
AndrewJSchofield merged PR #20983:
URL: https://github.com/apache/kafka/pull/20983
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org