Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-3426

CXF JMSContinuation leaks threads

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3, 2.2.11, 2.2.12, 2.3.1, 2.3.2, 2.3.3
    • 2.4, 2.3.4
    • Transports
    • None

    Description

      JMSContinuation contains this method:

      protected void createTimerTask(long timeout) {
              timer = new Timer();
              timer.schedule(new TimerTask() {
                  public void run() {
                      synchronized (JMSContinuation.this) { 
                          if (isPending) {
                              doResume();
                          }
                      }
                  }
              }, timeout);
          }
      

      The 'if' statement should be changed to:

      if (isPending) {
                  cancelTimerTask();
                  doResume();
      }
      

      The current impl causes cancel() not to be called on the Timer instance if timeout is triggered. This causes threads created by Timer instances to be leaked.

      Please note: as stated above - the leak is only observable when timeouts are triggered on these continuations. If no timeouts are triggered and the orginary resume() method is called, this class does nto leak threads.

      Attachments

        Activity

          People

            njiang Willem Jiang
            njiang Willem Jiang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: