Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-1952

NPE logged at warn if MQTT subscriber disconnects abruptly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.0, 2.6.1
    • Fix Version/s: 2.7.0
    • Component/s: MQTT
    • Labels:
      None

      Description

      If I connect a python paso MQTT client, create a subscriber, then disconnect abruptly, the following stacktace appears in the Artemis log.  I see the same defect on 2.6.0 and 2.6.1 (and master).  2.5.0 didn't exhibit the issue.

      If the client disconnects gracefully, or the client does not subscribe, the issue does not appear.

      Outwardly, it appears the broker is unaffected.

       

      2018-06-22 11:37:07,383 WARN  [org.apache.activemq.artemis.utils.actors.OrderedExecutor] null: java.lang.NullPointerException
          at org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolManager.isClientConnected(MQTTProtocolManager.java:182) [artemis-mqtt-protocol-2.7.0-SNAPSHOT.jar:]
          at org.apache.activemq.artemis.core.protocol.mqtt.MQTTConnectionManager.disconnect(MQTTConnectionManager.java:150) [artemis-mqtt-protocol-2.7.0-SNAPSHOT.jar:]
          at org.apache.activemq.artemis.core.protocol.mqtt.MQTTFailureListener.connectionFailed(MQTTFailureListener.java:37) [artemis-mqtt-protocol-2.7.0-SNAPSHOT.jar:]
          at org.apache.activemq.artemis.core.protocol.mqtt.MQTTConnection.fail(MQTTConnection.java:147) [artemis-mqtt-protocol-2.7.0-SNAPSHOT.jar:]
          at org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl.issueFailure(RemotingServiceImpl.java:561) [artemis-server-2.7.0-SNAPSHOT.jar:2.7.0-SNAPSHOT]
          at org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl.connectionDestroyed(RemotingServiceImpl.java:542) [artemis-server-2.7.0-SNAPSHOT.jar:2.7.0-SNAPSHOT]
          at org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor$Listener.connectionDestroyed(NettyAcceptor.java:845) [artemis-server-2.7.0-SNAPSHOT.jar:2.7.0-SNAPSHOT]
          at org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.lambda$channelInactive$0(ActiveMQChannelHandler.java:83) [artemis-core-client-2.7.0-SNAPSHOT.jar:2.7.0-SNAPSHOT]
          at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:42) [artemis-commons-2.7.0-SNAPSHOT.jar:2.7.0-SNAPSHOT]
          at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:31) [artemis-commons-2.7.0-SNAPSHOT.jar:2.7.0-SNAPSHOT]
          at org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:66) [artemis-commons-2.7.0-SNAPSHOT.jar:2.7.0-SNAPSHOT]
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_171]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_171]
          at org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) [artemis-commons-2.7.0-SNAPSHOT.jar:2.7.0-SNAPSHOT]

       

      The program to reproduce the issue is simply:

       

      import paho.mqtt.client as mqtt
      
      client = mqtt.Client()
      client.connect("localhost", 1883, 60)
      client.subscribe("any/old/thing")
      
      # if the following line is commented, the NPE is reported to the logs of the broker
      # client.disconnect()

       

       

       

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kwall Keith Wall
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m