Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-4841

NetworkClient should only consider a connection to be fail after attempt to connect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.11.0.0
    • None
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              lindong Dong Lin
              lindong Dong Lin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: