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

Lakatos Gyula commented on ARTEMIS-2657:
----------------------------------------

I can understand that. :S However, I myself found zero clues why could 
something like this happen. Let me describe what my application does, maybe 
that could help.

The server (very minimalistic, embedded Artemis) and the client applications 
are both written in (reactive) Spring Boot. None of them uses the Spring Boot 
Starters, everything is hand-wired.

The code for the client configuration is available here: 
[https://github.com/bottomless-archive-project/library-of-alexandria/blob/master/loa-service/loa-queue-artemis-service/src/main/java/com/github/loa/queue/artemis/configuration/QueueClientConfiguration.java]

The code for the server configuration is available here: 
[https://github.com/bottomless-archive-project/library-of-alexandria/blob/master/loa-service/loa-queue-artemis-service/src/main/java/com/github/loa/queue/artemis/configuration/QueueServerConfiguration.java]

The application is sending large messages (1 kb - 100 mb) between two 
applications using the Artemis Core API.

At the startup of the application, it opens 10 connections to the server like 
this: 
[https://github.com/bottomless-archive-project/library-of-alexandria/blob/master/loa-service/loa-queue-artemis-service/src/main/java/com/github/loa/queue/artemis/service/consumer/pool/ClientConsumerFactory.java]

 The created connections are then cached by a library called 
[stormpot|[https://github.com/chrisvest/stormpot]].

Then this rather awkwardly named class does the reading: 
[https://github.com/bottomless-archive-project/library-of-alexandria/blob/master/loa-service/loa-queue-artemis-service/src/main/java/com/github/loa/queue/artemis/service/ArtemisQueueManipulator.java]

The server was shut down abruptly (sigkilled) a couple of hours before the 
error happened but I'm unsure if this has anything to do with the problem.

Both of the applications are running on the same Windows 10 machine and both of 
them are being run on a Java 13 VM (build 13.0.2+8). The Netty version used is 
4.1.45.Final (provided by Spring).

The client is set to auto-reconnect indefinitely (setReconnectAttempts(-1)).

To be honest I'm also unsure why this happened. It only did twice, totally 
randomly. I'm not even a hundred percent right that this could be an issue in 
Artemis. However, I see no mentioning of anything about my application in the 
exception so I thought that it's better to report it.

> java.lang.Error: Maximum permit count exceeded
> ----------------------------------------------
>
>                 Key: ARTEMIS-2657
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2657
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.11.0
>            Reporter: Lakatos Gyula
>            Priority: Minor
>
> I'm not sure that this is a bug or I misconfigured something but because the 
> whole thing works for days and then stops because of this I think it's the 
> former.
>  
> {noformat}
> 2020-03-15 00:11:54.922 ERROR 17056 --- [-netty-threads)] 
> org.apache.activemq.artemis.core.client  : AMQ214013: Failed to decode packet
> java.lang.Error: Maximum permit count exceeded
>       at 
> java.base/java.util.concurrent.Semaphore$Sync.tryReleaseShared(Semaphore.java:198)
>  ~[na:na]
>       at 
> java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1382)
>  ~[na:na]
>       at java.base/java.util.concurrent.Semaphore.release(Semaphore.java:619) 
> ~[na:na]
>       at 
> org.apache.activemq.artemis.core.client.impl.ClientProducerCreditsImpl.receiveCredits(ClientProducerCreditsImpl.java:112)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.client.impl.ClientProducerCreditManagerImpl.receiveCredits(ClientProducerCreditManagerImpl.java:118)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.handleReceiveProducerCredits(ClientSessionImpl.java:1524)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.spi.core.remoting.SessionContext.handleReceiveProducerCredits(SessionContext.java:121)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.handleReceiveProducerCredits(ActiveMQSessionContext.java:987)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext$ClientSessionPacketHandler.handlePacket(ActiveMQSessionContext.java:1068)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.handlePacket(ChannelImpl.java:720)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:408)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:385)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl$DelegatingBufferHandler.bufferReceived(ClientSessionFactoryImpl.java:1204)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:73)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321)
>  ~[netty-codec-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295)
>  ~[netty-codec-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) 
> ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576) 
> ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) 
> ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
>  ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
>       at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  ~[artemis-commons-2.11.0.jar:2.11.0]
> 2020-03-15 00:11:54.923 ERROR 17056 --- [-netty-threads)] 
> org.apache.activemq.artemis.core.client  : AMQ214031: Failed to decode 
> buffer, disconnect immediately.
> java.lang.IllegalStateException: java.lang.Error: Maximum permit count 
> exceeded
>       at 
> org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:390)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl$DelegatingBufferHandler.bufferReceived(ClientSessionFactoryImpl.java:1204)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:73)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321)
>  ~[netty-codec-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295)
>  ~[netty-codec-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) 
> ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
>  ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576) 
> ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) 
> ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
>  ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
>       at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
>       at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  ~[artemis-commons-2.11.0.jar:2.11.0]
> Caused by: java.lang.Error: Maximum permit count exceeded
>       at 
> java.base/java.util.concurrent.Semaphore$Sync.tryReleaseShared(Semaphore.java:198)
>  ~[na:na]
>       at 
> java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1382)
>  ~[na:na]
>       at java.base/java.util.concurrent.Semaphore.release(Semaphore.java:619) 
> ~[na:na]
>       at 
> org.apache.activemq.artemis.core.client.impl.ClientProducerCreditsImpl.receiveCredits(ClientProducerCreditsImpl.java:112)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.client.impl.ClientProducerCreditManagerImpl.receiveCredits(ClientProducerCreditManagerImpl.java:118)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.handleReceiveProducerCredits(ClientSessionImpl.java:1524)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.spi.core.remoting.SessionContext.handleReceiveProducerCredits(SessionContext.java:121)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.handleReceiveProducerCredits(ActiveMQSessionContext.java:987)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext$ClientSessionPacketHandler.handlePacket(ActiveMQSessionContext.java:1068)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.handlePacket(ChannelImpl.java:720)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:408)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       at 
> org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:385)
>  ~[artemis-core-client-2.11.0.jar:2.11.0]
>       ... 22 common frames omitted
> 2020-03-15 00:11:54.925  WARN 17056 --- [global-threads)] 
> org.apache.activemq.artemis.core.client  : AMQ212037: Connection failure to 
> /127.0.0.1:61616 has been detected: java.lang.Error: Maximum permit count 
> exceeded [code=GENERIC_EXCEPTION]
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to