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

ConsumerNetworkClient.send() should not require global lock

    XMLWordPrintableJSON

Details

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

    Description

      Currently `ConsumerNetworkClient.send()` needs to acquire global lock of `ConumserNetworkClient` in order to enqueue requests. If another thread has called `ConsumerNetworkClient.poll(..)`, that thread may be holding the lock while blocked on `nioSelector.select(ms)`. This causes problem because the user thread which calls `ConsumerNetworkClient.send()` will also block waiting for that `nioSelector.select(ms)` to finish.

      One way to address this problem is to use `synchronized (unsent)` to protect access to `ConsumeNetworkClient.unsent` instead of protecting it using a global lock. So that user thread should be able to enqueue requests immediately while another thread is blocked on `nioSelector.select(ms)`.

      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: