Boris Zhguchev created KAFKA-7351:
-------------------------------------
Summary: Wrong logic in method
ClusterConnectionStates.isDisconnected
Key: KAFKA-7351
URL: https://issues.apache.org/jira/browse/KAFKA-7351
Project: Kafka
Issue Type: Bug
Components: clients
Affects Versions: 2.0.0
Reporter: Boris Zhguchev
I think the method ClusterConnectionStates.isDisconnected has wrong logic in
proccesing wrong ids.
{code:java}
@Before
public void setup() {
this.connectionStates = new ClusterConnectionStates(10_000, 60_000);
}
@Test
public void testIsDisconnected(){
boolean connected = connectionStates.isConnected("fake_node");
boolean disconnected = connectionStates.isDisconnected("fake_node");
assertFalse(connected); // false
assertFalse(disconnected); // false
}
{code}
It can be related with that that code block:
{code:java}
public boolean isDisconnected(String id) {
NodeConnectionState state = nodeState.get(id);
// may be better is state == null ? true : state.isDisconnected()
return state != null && state.state.isDisconnected();
}
{code}
[link|https://github.com/apache/kafka/blob/19b8ac55c389e4b2022476431a28c8431caed52a/clients/src/main/java/org/apache/kafka/clients/ClusterConnectionStates.java#L252]
to github
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)