Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-6051

ActiveMQConnection leaking thread when resources are not well closed

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.12.0
    • 5.13.0
    • None
    • None

    Description

      ActiveMQConnection starts a session task thread but doesnt close it if close() is called and the broker doesnt respond

                          try {
                              if (isConnectionInfoSentToBroker) {
                                  // If we announced ourselves to the broker.. Try to let the broker
                                  // know that the connection is being shutdown.
                                  RemoveInfo removeCommand = info.createRemoveCommand();
                                  removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId);
                                  try {
                                      doSyncSendPacket(removeCommand, closeTimeout);
                                  } catch (JMSException e) {
                                      if (e.getCause() instanceof RequestTimedOutIOException) {
                                          // expected
                                      } else {
                                          throw e;
                                      }
                                  }
                                  doAsyncSendPacket(new ShutdownInfo());
                              }
                          } finally {
                              // ensure we clean up this connection anyway even if previous send fail
                              // which can happen if we lost the connection with the broker
      
                              started.set(false);
      
                              // TODO if we move the TaskRunnerFactory to the connection
                              // factory
                              // then we may need to call
                              // factory.onConnectionClose(this);
                              if (sessionTaskRunner != null) {
                                  sessionTaskRunner.shutdown();
                              }
                              closed.set(true);
                              closing.set(false);
                          }
      

      solves it

      tested on 5.12.0 but 5.12.x has the same code so I guess it has the same issue

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            tabish Timothy A. Bish
            romain.manni-bucau Romain Manni-Bucau
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment