[ https://issues.apache.org/jira/browse/ARTEMIS-4542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17809702#comment-17809702 ]
ASF subversion and git services commented on ARTEMIS-4542: ---------------------------------------------------------- Commit 019fc86138239cc34e84dd4c90326e6615e75e6b in activemq-artemis's branch refs/heads/main from Justin Bertram [ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=019fc86138 ] ARTEMIS-4542 improve MQTT state storage This commit: - Eliminates MQTT session storage on every successful connection. Instead data is only written when subsriptions are created or destroyed. - Adds a configuration property for the storage timeout. - Updates the documentation with relevant information. - Refactors a few bits of code to eliminate unnecessary variables, etc. > "Error disconnecting client" after connecting and disconnecting a few times > --------------------------------------------------------------------------- > > Key: ARTEMIS-4542 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4542 > Project: ActiveMQ Artemis > Issue Type: Bug > Affects Versions: 2.31.0 > Reporter: Daniel Martin > Assignee: Justin Bertram > Priority: Major > Time Spent: 40m > Remaining Estimate: 0h > > During some local tests which involved manually disconnecting and > reconnecting one MQTT client, at one point the ability to (re)connect was > lost, while the MQTT server kept printing the following message: > {noformat} > 2023-12-19 16:09:35,105 ERROR > [org.apache.activemq.artemis.core.protocol.mqtt] AMQ834002: Error processing > control packet: > MqttConnectMessage[fixedHeader=MqttFixedHeader[messageType=CONNECT, > isDup=false, qosLevel=AT_MOST_ONCE, isRetain=false, remainingLength=81], > variableHeader=MqttConnectVariableHeader[name=MQTT, version=5, > hasUserName=true, hasPassword=true, isWillRetain=false, isWillFlag=false, > isCleanSession=false, keepAliveTimeSeconds=60], > payload=MqttConnectPayload[clientIdentifier=99778aca-86a8-4b3e-84b9-74778c77e0e1, > willTopic=null, willMessage=null, userName=artemis, password=[...]]] > java.lang.IllegalStateException: AMQ850000: Unable to store MQTT state within > given timeout: 5000ms > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTStateManager.storeSessionState(MQTTStateManager.java:177) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTStateManager.getSessionState(MQTTStateManager.java:130) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTConnectionManager.getSessionState(MQTTConnectionManager.java:206) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTConnectionManager.connect(MQTTConnectionManager.java:71) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.handleConnect(MQTTProtocolHandler.java:267) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.act(MQTTProtocolHandler.java:159) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at org.apache.activemq.artemis.utils.actors.Actor.doTask(Actor.java:32) > ~[artemis-commons-2.31.0.jar:?] > at > org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:68) > ~[artemis-commons-2.31.0.jar:?] > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) > [?:?] > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) > [?:?] > at > org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) > [artemis-commons-2.31.0.jar:?] > 2023-12-19 16:09:40,105 ERROR > [org.apache.activemq.artemis.core.protocol.mqtt] AMQ834001: Error > disconnecting client. > java.lang.IllegalStateException: AMQ850000: Unable to store MQTT state within > given timeout: 5000ms > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTStateManager.storeSessionState(MQTTStateManager.java:177) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTSubscriptionManager.removeSubscriptions(MQTTSubscriptionManager.java:291) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTSubscriptionManager.clean(MQTTSubscriptionManager.java:368) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTSession.clean(MQTTSession.java:233) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTSession.stop(MQTTSession.java:136) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTConnectionManager.disconnect(MQTTConnectionManager.java:186) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.disconnect(MQTTProtocolHandler.java:282) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.act(MQTTProtocolHandler.java:183) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at org.apache.activemq.artemis.utils.actors.Actor.doTask(Actor.java:32) > ~[artemis-commons-2.31.0.jar:?] > at > org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:68) > ~[artemis-commons-2.31.0.jar:?] > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) > [?:?] > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) > [?:?] > at > org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) > [artemis-commons-2.31.0.jar:?] > 2023-12-19 16:09:45,106 ERROR > [org.apache.activemq.artemis.core.protocol.mqtt] AMQ834001: Error > disconnecting client. > java.lang.IllegalStateException: AMQ850000: Unable to store MQTT state within > given timeout: 5000ms > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTStateManager.storeSessionState(MQTTStateManager.java:177) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTSubscriptionManager.removeSubscriptions(MQTTSubscriptionManager.java:291) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTSubscriptionManager.clean(MQTTSubscriptionManager.java:368) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTSession.clean(MQTTSession.java:233) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTSession.stop(MQTTSession.java:136) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTConnectionManager.disconnect(MQTTConnectionManager.java:186) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.disconnect(MQTTProtocolHandler.java:282) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.disconnect(MQTTProtocolHandler.java:272) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.act(MQTTProtocolHandler.java:198) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at org.apache.activemq.artemis.utils.actors.Actor.doTask(Actor.java:32) > ~[artemis-commons-2.31.0.jar:?] > at > org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:68) > ~[artemis-commons-2.31.0.jar:?] > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) > [?:?] > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) > [?:?] > at > org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) > [artemis-commons-2.31.0.jar:?] > 2023-12-19 16:09:45,109 ERROR > [org.apache.activemq.artemis.core.protocol.mqtt] AMQ834002: Error processing > control packet: > MqttConnectMessage[fixedHeader=MqttFixedHeader[messageType=CONNECT, > isDup=false, qosLevel=AT_MOST_ONCE, isRetain=false, remainingLength=81], > variableHeader=MqttConnectVariableHeader[name=MQTT, version=5, > hasUserName=true, hasPassword=true, isWillRetain=false, isWillFlag=false, > isCleanSession=false, keepAliveTimeSeconds=60], > payload=MqttConnectPayload[clientIdentifier=dc6b05c6-c09f-4d41-976b-70ae7017d1e3, > willTopic=null, willMessage=null, userName=artemis, password=[...]]] > java.lang.IllegalStateException: AMQ850000: Unable to store MQTT state within > given timeout: 5000ms > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTStateManager.storeSessionState(MQTTStateManager.java:177) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTStateManager.getSessionState(MQTTStateManager.java:130) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTConnectionManager.getSessionState(MQTTConnectionManager.java:206) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTConnectionManager.connect(MQTTConnectionManager.java:71) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.handleConnect(MQTTProtocolHandler.java:267) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at > org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.act(MQTTProtocolHandler.java:159) > ~[artemis-mqtt-protocol-2.31.0.jar:2.31.0] > at org.apache.activemq.artemis.utils.actors.Actor.doTask(Actor.java:32) > ~[artemis-commons-2.31.0.jar:?] > at > org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:68) > ~[artemis-commons-2.31.0.jar:?] > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) > [?:?] > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) > [?:?] > at > org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) > [artemis-commons-2.31.0.jar:?] > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010)