Vincent Sevel created ARTEMIS-5551:
--------------------------------------

             Summary: HornetQClientProtocolManager NPE when shutting down one 
member
                 Key: ARTEMIS-5551
                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5551
             Project: ActiveMQ Artemis
          Issue Type: Bug
            Reporter: Vincent Sevel


hello,

I have a quarkus application connecting to a HornetQ broker (cluster of 2 
replicas)

we are using the artemis-hqclient-protocol version 2.41.0

when shutting down one member, my application continues to work on the other 
member, but several error messages gets logged including the following NPE:

2025-06-23 11:54:31,746 ERROR [org.apache.activemq.artemis.core.client] 
(Thread-11 (ActiveMQ-client-netty-threads)) AMQ214031: Failed to decode buffer, 
disconnect immediately.
java.lang.IllegalStateException: java.lang.NullPointerException: Cannot invoke 
"org.apache.activemq.artemis.api.core.Pair.getA()" because the return value of 
"org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ClusterTopologyChangeMessage.getPair()"
 is null
    at 
org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:386)
    at 
org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl$DelegatingBufferHandler.bufferReceived(ClientSessionFactoryImpl.java:1324)
    at 
org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:73)
    at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
    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:346)
    at 
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
    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.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
    at 
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:796)
    at 
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:732)
    at 
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:658)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
    at 
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at 
org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:120)
Caused by: java.lang.NullPointerException: Cannot invoke 
"org.apache.activemq.artemis.api.core.Pair.getA()" because the return value of 
"org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ClusterTopologyChangeMessage.getPair()"
 is null
    at 
org.apache.activemq.artemis.core.protocol.hornetq.client.HornetQClientProtocolManager.updateTransportConfiguration(HornetQClientProtocolManager.java:78)
    at 
org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQClientProtocolManager$Channel0Handler.handlePacket(ActiveMQClientProtocolManager.java:487)
    at 
org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.handlePacket(ChannelImpl.java:854)
    at 
org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:408)
    at 
org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:381)
    ... 22 more



HornetQClientProtocolManager should be made more defensive in 
updateTransportConfiguration()



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to