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: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: 5.1.0
    • 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.amend.001.patch
          0.7 kB
          Andras Piros
        4. OOZIE-3160.amend.002.patch
          4 kB
          Andras Piros
        5. OOZIE-3160.amend.003.patch
          10 kB
          Andras Piros
        6. OOZIE-3160.amend.004.patch
          22 kB
          Andras Piros
        7. OOZIE-3160.amend.005.patch
          22 kB
          Andras Piros
        8. OOZIE-3160-001.patch
          61 kB
          Peter Bacsko
        9. OOZIE-3160-002.patch
          64 kB
          Peter Bacsko
        10. OOZIE-3160-003.patch
          65 kB
          Peter Bacsko
        11. OOZIE-3160-004.patch
          66 kB
          Peter Bacsko
        12. OOZIE-3160-005.patch
          65 kB
          Peter Bacsko
        13. OOZIE-3160-006.patch
          66 kB
          Peter Bacsko
        14. OOZIE-3160-007.patch
          67 kB
          Peter Bacsko
        15. OOZIE-3160-POC01.patch
          11 kB
          Peter Bacsko
        16. OOZIE-3160-POC02.patch
          20 kB
          Peter Bacsko
        17. OOZIE-3160-POC02.patch
          20 kB
          Peter Bacsko
        18. OOZIE-3160-POC03.patch
          25 kB
          Peter Bacsko
        19. OOZIE-3160-POC04.patch
          38 kB
          Peter Bacsko
        20. OOZIE-3160-POC05.patch
          53 kB
          Peter Bacsko
        21. 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:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: