[ 
https://issues.apache.org/jira/browse/KAFKA-21531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lucy Liu updated KAFKA-21531:
-----------------------------
    Summary: setSessionTimeout works incorrectly in 
ReplicationControlTestContext  (was: setSessionTimeout works incorrectly in 
ReplicationControlManagerTest)

> 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
>            Priority: Minor
>             Fix For: 4.5.0
>
>
> {{setSessionTimeoutNs(TimeUnit.MILLISECONDS.convert(BROKER_SESSION_TIMEOUT_MS,
>  TimeUnit.NANOSECONDS))}} converts 1000 _nanoseconds_ to milliseconds, so the 
> session timeout is actually 0 instead of the intended 1 second. The intended 
> form would be 
> {{{}TimeUnit.MILLISECONDS.toNanos(BROKER_SESSION_TIMEOUT_MS){}}}.
> Fixing only the conversion makes 17 tests in 
> {{ReplicationControlManagerTest}} fail, because {{fenceBrokers}} sleeps 
> exactly {{{}BROKER_SESSION_TIMEOUT_MS{}}}, while 
> {{BrokerHeartbeatTracker#isExpired}} only treats a session as expired when 
> {{timeNs + sessionTimeoutNs < nowNs}} (strictly greater). So a proper fix 
> also needs the sleep in {{fenceBrokers}} adjusted.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to