[ 
https://issues.apache.org/jira/browse/ARTEMIS-1952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16774472#comment-16774472
 ] 

ASF subversion and git services commented on ARTEMIS-1952:
----------------------------------------------------------

Commit 16909584c336b6e5a58434629494be6ca7477b52 in activemq-artemis's branch 
refs/heads/master from Otavio R. Piske
[ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=1690958 ]

ARTEMIS-1952 NPE logged at warn if MQTT subscriber disconnects abruptly

Prevent a NullPointerException if no connection by the given clientId is
found on the cache of stored sessions


> NPE logged at warn if MQTT subscriber disconnects abruptly
> ----------------------------------------------------------
>
>                 Key: ARTEMIS-1952
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1952
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: MQTT
>    Affects Versions: 2.6.0, 2.6.1
>            Reporter: Keith Wall
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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.
>  
> {noformat}
> 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]{noformat}
>  
> The program to reproduce the issue is simply:
>  
> {code:java}
> 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(){code}
>  
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to