soarez commented on code in PR #14836:
URL: https://github.com/apache/kafka/pull/14836#discussion_r1410038816
##########
core/src/test/scala/unit/kafka/server/BrokerLifecycleManagerTest.scala:
##########
@@ -201,7 +201,7 @@ class BrokerLifecycleManagerTest {
while (!future.isDone || context.mockClient.hasInFlightRequests) {
context.poll()
manager.eventQueue.wakeup()
- context.time.sleep(100)
+ context.time.sleep(5)
Review Comment:
@junrao : That's a good point, you're right. In between `HeartbeatRequest`
being sent and the response being handled, `propagateDirectoryFailure` could be
called, immediately scheduling a `HeartbeatRequest`, causing an extra request.
It looks like this was already the case with `setReadyToUnfence()` and
`beginControlledShutdown()`, which can also cause an extra request in the same
way.
We can avoid the extra requests by checking - in `OfflineDirEvent.run`,
`SetReadyToUnfenceEvent.run` and `BeginControlledShutdownEvent.run` - whether
a request is inflight, and delaying calling
`scheduleNextCommunicationImmediately` until after the response is received.
Please see #14874 about there explaining comment for the test.
I also see you've filed
[KAFKA-15950](https://issues.apache.org/jira/browse/KAFKA-15950). Thanks, I'll
have a look.
--
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]