You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@artemis.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2026/09/03 16:20:00 UTC

[jira] [Commented] (ARTEMIS-6217) Mitigate spurious logging for MQTT during shutdown

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

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

Commit 1be8581d109b18af27f9365bf50118463c5877ab in artemis's branch refs/heads/main from Justin Bertram
[ https://gitbox.apache.org/repos/asf?p=artemis.git;h=1be8581d10 ]

ARTEMIS-6217 mitigate spurious shutdown MQTT logs

When the broker is processing MQTT packets (especially those related to
QoS 2 message flows) a shutdown can cause the broker to log spurious
messages, including several different stack-traces that are effectively
harmless, but can alarm users. The broker should detect these and avoid
logging them.

Co-Authored-By: Claude <no...@anthropic.com>


> Mitigate spurious logging for MQTT during shutdown
> --------------------------------------------------
>
>                 Key: ARTEMIS-6217
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-6217
>             Project: Artemis
>          Issue Type: Improvement
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> When the broker is processing MQTT packets (especially those related to QoS 2 message flows) a shutdown can cause the broker to log several different stack-traces that are effectively harmless, but can alarm users. The broker should detect these and avoid logging them. Here are a few examples:
> {noformat}
> [Thread-8 (activemq-remoting--m-q-t-t-localhost)] 21:55:32,925 ERROR [org.apache.activemq.artemis.core.protocol.mqtt] AMQ834001: Error disconnecting client.
> java.lang.RuntimeException: AMQ229257: IDGenerator has been stopped
> 	at org.apache.activemq.artemis.core.persistence.impl.journal.BatchingIDGenerator.generateID(BatchingIDGenerator.java:144)
> 	at org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager.generateID(AbstractJournalStorageManager.java:371)
> 	at org.apache.activemq.artemis.core.transaction.impl.TransactionImpl.<init>(TransactionImpl.java:109)
> 	at org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl.close(ServerConsumerImpl.java:589)
> 	at org.apache.activemq.artemis.core.protocol.mqtt.MQTTSubscriptionManager.stop(MQTTSubscriptionManager.java:138)
> 	at org.apache.activemq.artemis.core.protocol.mqtt.MQTTSession.stop(MQTTSession.java:120)
> 	at org.apache.activemq.artemis.core.protocol.mqtt.MQTTConnectionManager.disconnect(MQTTConnectionManager.java:195)
> 	at org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.disconnect(MQTTProtocolHandler.java:304)
> 	at org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.disconnect(MQTTProtocolHandler.java:294)
> 	at org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.channelRead(MQTTProtocolHandler.java:133)
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
> 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
> 	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:361)
> 	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:348)
> 	at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:349)
> 	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
> 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
> 	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1357)
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
> 	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:868)
> 	at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:805)
> 	at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:501)
> 	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:399)
> 	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:1007)
> 	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
> 	at org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:120){noformat}
> {noformat}
> [Thread-8 (activemq-localhost)] 21:55:33,023 WARN  [org.apache.activemq.artemis.core.protocol.mqtt] AMQ832000: Unable to send message to MQTT client sub-4: Reference[9155]:RELIABLE:CoreMessage[messageID=9155, durable=true, userID=null, priority=0, timestamp=Thu Aug 27 21:55:28 UTC 2026, expiration=0, durable=true, address=qos2.resiliency, size=230, properties=TypedProperties[__AMQ_CID=pub, _AMQ_ROUTING_TYPE=0, mqtt.message.retain=false, mqtt.qos.level=2]]@1605464199
> java.lang.RuntimeException: AMQ229257: IDGenerator has been stopped
> 	at org.apache.activemq.artemis.core.persistence.impl.journal.BatchingIDGenerator.generateID(BatchingIDGenerator.java:144)
> 	at org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager.generateID(AbstractJournalStorageManager.java:371)
> 	at org.apache.activemq.artemis.core.journal.collections.JournalHashMap.put(JournalHashMap.java:198)
> 	at org.apache.activemq.artemis.core.protocol.mqtt.MQTTStateManager.putPacketIdCorrelation(MQTTStateManager.java:229)
> 	at org.apache.activemq.artemis.core.protocol.mqtt.MQTTPublishManager.publishToClient(MQTTPublishManager.java:130)
> 	at org.apache.activemq.artemis.core.protocol.mqtt.MQTTSessionCallback.sendMessage(MQTTSessionCallback.java:52)
> 	at org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl.deliverStandardMessage(ServerConsumerImpl.java:1217)
> 	at org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl.proceedDeliver(ServerConsumerImpl.java:525)
> 	at org.apache.activemq.artemis.core.server.impl.QueueImpl.proceedDeliver(QueueImpl.java:3881)
> 	at org.apache.activemq.artemis.core.server.impl.QueueImpl.deliver(QueueImpl.java:3127)
> 	at org.apache.activemq.artemis.core.server.impl.QueueImpl$DeliverRunner.run(QueueImpl.java:4238)
> 	at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:59)
> 	at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:32)
> 	at org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:69)
> 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
> 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
> 	at org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:120){noformat}
> {noformat}
> [Thread-3 (activemq-localhost)] 11:22:07,106 ERROR [org.apache.activemq.artemis.core.protocol.mqtt] AMQ834002: Error processing MQTT packet; client ID: sub-6; packet: PUBCOMP(11535) reasonCode=0x00; Journal must be in state=LOADED, was [STOPPED]
> org.apache.activemq.artemis.api.core.ActiveMQShutdownException: [errorType=SHUTDOWN_ERROR message=Journal must be in state=LOADED, was [STOPPED]]
> 	at org.apache.activemq.artemis.core.journal.impl.JournalImpl.checkJournalIsLoaded(JournalImpl.java:1304)
> 	at org.apache.activemq.artemis.core.journal.impl.JournalImpl.tryAppendDeleteRecord(JournalImpl.java:1179)
> 	at org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager.deleteDuplicateID(AbstractJournalStorageManager.java:575)
> 	at org.apache.activemq.artemis.core.postoffice.impl.PersistentDuplicateIDCache.deleteFromCache(PersistentDuplicateIDCache.java:170)
> 	at org.apache.activemq.artemis.core.postoffice.impl.PersistentDuplicateIDCache.deleteFromCache(PersistentDuplicateIDCache.java:149)
> 	at org.apache.activemq.artemis.core.protocol.mqtt.PacketIdCache.remove(PacketIdCache.java:77)
> 	at org.apache.activemq.artemis.core.protocol.mqtt.MQTTPublishManager.handlePubComp(MQTTPublishManager.java:302)
> 	at org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.handlePubcomp(MQTTProtocolHandler.java:411)
> 	at org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.act(MQTTProtocolHandler.java:197)
> 	at org.apache.activemq.artemis.utils.actors.Actor.doTask(Actor.java:32)
> 	at org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:69)
> 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
> 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
> 	at org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:120){noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org