Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-12528

Avoid spinning in CallQueueManager.take()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Minor
    • Resolution: Unresolved
    • 2.7.1
    • None
    • performance
    • None

    Description

      When IPC threads (Server$Handler) does take() to get the next Call, the CallManager does a poll instead of take() on the internal queue.

      This causes threads to wake up and unnecessarily waste some CPU and do extra allocation as part of the internal await/signal mechanism each time the thread redoes poll().

      This patch uses take() on the queue instead of poll() which will keep thread in the await state until work is available. Since threads will be blocked on the queue indefinitely the swapping of queues requires a bit of extra work to make sure threads wake up and does take on the new queue.

      Updated the test TestCallQueueManager.testSwapUnderContention() to ensure that no threads get stuck on the old queue as part of swapping.

      Attachments

        1. HADOOP-12528.001.patch
          7 kB
          Staffan Friberg
        2. HADOOP-12528.002.patch
          7 kB
          Staffan Friberg

        Activity

          People

            sfriberg Staffan Friberg
            sfriberg Staffan Friberg
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: