chia7712 commented on code in PR #15843:
URL: https://github.com/apache/kafka/pull/15843#discussion_r1586996403


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:
##########
@@ -906,6 +906,7 @@ public long position(TopicPartition partition, Duration 
timeout) {
                     return position.offset;
 
                 updateFetchPositions(timer);
+                timer.update();

Review Comment:
   (this comment is unrelated to this PR)
   
   It seems `AsyncConsumer#position` does not honour `WakupException`? see 
following test
   ```scala
     @ParameterizedTest(name = 
TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
     @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
     @Timeout(10)
     def testPositionRespectsWakeup(quorum: String, groupProtocol: String): 
Unit = {
       val topicPartition = new TopicPartition("abc", 15)
       val consumer = createConsumer()
       consumer.assign(List(topicPartition).asJava)
       val service = Executors.newSingleThreadExecutor()
       service.execute(() => {
         TimeUnit.SECONDS.sleep(1)
         consumer.wakeup()
       })
       try assertThrows(classOf[WakeupException], () => 
consumer.position(topicPartition, Duration.ofSeconds(3)))
       finally {
         service.shutdownNow()
         service.awaitTermination(1, TimeUnit.SECONDS)
       }
     }
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to