[
https://issues.apache.org/jira/browse/KAFKA-21531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chia-Ping Tsai resolved KAFKA-21531.
------------------------------------
Resolution: Fixed
> setSessionTimeout works incorrectly in ReplicationControlTestContext
> --------------------------------------------------------------------
>
> Key: KAFKA-21531
> URL: https://issues.apache.org/jira/browse/KAFKA-21531
> Project: Kafka
> Issue Type: Test
> Components: controller
> Reporter: Lucy Liu
> Assignee: Chia-Cheng Chueh
> Priority: Minor
> Fix For: 4.5.0
>
>
> In ReplicationControlTestContext,
> {{setSessionTimeoutNs(TimeUnit.MILLISECONDS.convert(BROKER_SESSION_TIMEOUT_MS,
> TimeUnit.NANOSECONDS))}} converts 1000 _nanoseconds_ to milliseconds, so the
> broker session timeout is actually 0 instead of the intended 1 second.
> The existing tests in {{ReplicationControlManagerTest}} depend on this.
> Fixing only the conversion makes 17 of them fail, because {{fenceBrokers}}
> sleeps exactly {{{}BROKER_SESSION_TIMEOUT_MS{}}}, while
> {{BrokerHeartbeatTracker#isExpired}} only treats a session as expired when
> {{nowNs}} is strictly greater than {{{}timeNs + sessionTimeoutNs{}}}.
>
> context: https://github.com/apache/kafka/pull/24246#issuecomment-6902501036
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)