Uploaded image for project: 'Oozie'
  1. Oozie
  2. OOZIE-3160

PriorityDelayQueue put()/take() can cause significant CPU load due to busy waiting

    Details

    • Type: Bug
    • Status: Patch Available
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:

      all platforms

      Description

      oozie process always consume high cpu. in my mechine,around 10%.

      I check the source code,find take() method in PriorityDelayQueue class。

      code:

      public QueueElement<E> take() throws InterruptedException {
          QueueElement<E> e = poll();
          while (e == null) {
              Thread.sleep(10);
              e = poll();
          }
          return e;
      }
      

      i think it's the reason of this problem. it's keep while, not await.

        Attachments

        1. 11111111111111.png
          7 kB
          jj
        2. 222222222222222222.png
          73 kB
          jj
        3. OOZIE-3160-POC01.patch
          11 kB
          Peter Bacsko
        4. OOZIE-3160-POC02.patch
          20 kB
          Peter Bacsko
        5. OOZIE-3160-POC02.patch
          20 kB
          Peter Bacsko
        6. OOZIE-3160-POC03.patch
          25 kB
          Peter Bacsko
        7. PriorityDelayQueue improvement - OOZIE-3160.pdf
          348 kB
          Peter Bacsko

          Issue Links

            Activity

              People

              • Assignee:
                pbacsko Peter Bacsko
                Reporter:
                j782070772 jj
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: