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

Client blocks forever if SocketChannel connects instantly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.9.0.1
    • Fix Version/s: 0.10.0.0
    • Component/s: clients
    • Labels:
      None

      Description

      Observed that some consumers were blocked in Fetcher.listOffset() when starting many dozens of consumer threads at the same time.

      Selector.connect(...) calls SocketChannel.connect() in non-blocking mode and assumes that false is always returned and that the channel will be in the Selector's readyKeys once the connection is ready for connect completion due to the OP_CONNECT interest op.

      When connect() returns true the channel is fully connected connected and will not be included in readyKeys since only OP_CONNECT is set.

      I implemented a fix which handles the case when connect(...) returns true and verified that I no longer see stuck consumers. A git pull request will be forthcoming.

        Attachments

          Activity

            People

            • Assignee:
              llowrey@gmail.com Larkin Lowrey
              Reporter:
              llowrey@gmail.com Larkin Lowrey
              Reviewer:
              Jun Rao
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: