ActiveMQ
  1. ActiveMQ
  2. AMQ-2033

Deadlock on producerWindow.waitForSpace() in ActiveMQMessageProducer

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 5.2.0
    • Fix Version/s: 5.3.0
    • Component/s: Broker
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      It seems, that producer throttling with producerWindow enabled doesn't work at all. I'm attaching unit test for this. After sending about ~80msg producer stops and never resumes sending.
      The problem is that producerWindow is not started ActiveMQMessageProducer. There must be something like this:
      producerWindow.start();
      I'm also attaching patch for this bug

      1. producer.patch
        0.7 kB
        Danielius Jurna
      2. ProducerFlowControlTest.java
        10 kB
        Danielius Jurna
      3. ProducerFlowControlTest.patch
        2 kB
        Danielius Jurna
      4. producer.patch
        0.8 kB
        Danielius Jurna

        Activity

        Hide
        Gary Tully added a comment -

        I added a close to the original commit so the close (same as your second patch) is currently on trunk: see the diff

        Re the thread usage, and thread per producer. Please open another issue for that as SystemUsage may need a little refactor to obtain a thread pool or executor reference.

        Show
        Gary Tully added a comment - I added a close to the original commit so the close (same as your second patch) is currently on trunk: see the diff Re the thread usage, and thread per producer. Please open another issue for that as SystemUsage may need a little refactor to obtain a thread pool or executor reference.
        Hide
        Danielius Jurna added a comment -

        Now prducer has thread leak, because it doesn't close producerWindow on producer close. I've attached patch, which closes the producer window (this patch includes both fixes).

        Show
        Danielius Jurna added a comment - Now prducer has thread leak, because it doesn't close producerWindow on producer close. I've attached patch, which closes the producer window (this patch includes both fixes).
        Hide
        Danielius Jurna added a comment -

        Patch wich includes producer window stop

        Show
        Danielius Jurna added a comment - Patch wich includes producer window stop
        Hide
        Danielius Jurna added a comment -

        Updated

        Show
        Danielius Jurna added a comment - Updated
        Hide
        Danielius Jurna added a comment -

        Now with this patch, there is one thread for every producer created. On heavy systems, there are big amount of threads created (hundreds) and waiting, because every producerWindow has it's own thread executor. I thing they should reuse session thread pool or smth. Should I create new issue for this?

        Show
        Danielius Jurna added a comment - Now with this patch, there is one thread for every producer created. On heavy systems, there are big amount of threads created (hundreds) and waiting, because every producerWindow has it's own thread executor. I thing they should reuse session thread pool or smth. Should I create new issue for this?
        Hide
        Gary Tully added a comment -

        patch applied in r727353. Thanks for the fix and the test case,

        Show
        Gary Tully added a comment - patch applied in r727353. Thanks for the fix and the test case,
        Hide
        Danielius Jurna added a comment -

        Sorry, here is the patch for ProducerFlowControlTest

        Show
        Danielius Jurna added a comment - Sorry, here is the patch for ProducerFlowControlTest
        Hide
        Gary Tully added a comment -

        This looks like a good catch.
        w.r.t the test case you mentioned, do you also have a patch for the ProducerFlowControlTest. The ProducerFlowControlTest.java attachment is the same as the current trunk revision.

        Show
        Gary Tully added a comment - This looks like a good catch. w.r.t the test case you mentioned, do you also have a patch for the ProducerFlowControlTest. The ProducerFlowControlTest.java attachment is the same as the current trunk revision.

          People

          • Assignee:
            Gary Tully
            Reporter:
            Danielius Jurna
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development