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

Lucy Liu updated KAFKA-21531:
-----------------------------
    Description: 
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{}}}.

  was:
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}}.


> 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
>
>
> 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{}}}.



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

Reply via email to