[ https://issues.apache.org/jira/browse/KAFKA-4841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15900516#comment-15900516 ]
ASF GitHub Bot commented on KAFKA-4841: --------------------------------------- Github user asfgit closed the pull request at: https://github.com/apache/kafka/pull/2641 > NetworkClient should only consider a connection to be fail after attempt to > connect > ----------------------------------------------------------------------------------- > > Key: KAFKA-4841 > URL: https://issues.apache.org/jira/browse/KAFKA-4841 > Project: Kafka > Issue Type: Bug > Reporter: Dong Lin > Assignee: Dong Lin > > KAFKA-4820 allows new request to be enqueued to unsent by user thread while > some other thread does poll(...). This causes problem in the following > scenario: > - Thread A calls poll(...) and is blocked on select(...) > - Thread B enqueues a request into unsent of ConsumerNetworkClient for node N > - Thread A calls checkDisconnects(now) -> client.connectionFailed(N) > Because no attempts have been made to connection to node N yet, there is no > state for node N and connectionFailed(N) would throw exception. Note that > this problem only occurs when one thread is able to enqueue requests while > another thread is in the process of `poll(...)` > The solution is to only consider a connection has failed if attempts have > been made to connect to this node AND the connection state is DISCONNECTED. -- This message was sent by Atlassian JIRA (v6.3.15#6346)