redlsz opened a new issue, #7001: URL: https://github.com/apache/rocketmq/issues/7001
### Before Creating the Bug Report - [X] I found a bug, not just asking a question, which should be created in [GitHub Discussions](https://github.com/apache/rocketmq/discussions). - [X] I have searched the [GitHub Issues](https://github.com/apache/rocketmq/issues) and [GitHub Discussions](https://github.com/apache/rocketmq/discussions) of this repository and believe that this is not a duplicate. - [X] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ. ### Runtime platform environment centos7 / macos13 ### RocketMQ version develop branch ### JDK Version JDK 8 ### Describe the Bug When use the gRPC rocketmq-clients to consume messages, a java.lang.IndexOutOfBoundsException may occur in proxy, thrown by org.apache.rocketmq.client.impl.MQClientAPIImpl.processPopResponse `2023-07-07 15:02:08 ERROR ConsumerProcessorExecutor-5 - internal server error java.lang.IndexOutOfBoundsException: Index: 12, Size: 3 at java.util.ArrayList.rangeCheck(ArrayList.java:659) at java.util.ArrayList.get(ArrayList.java:435) at org.apache.rocketmq.client.impl.MQClientAPIImpl.processPopResponse(MQClientAPIImpl.java:1124) at org.apache.rocketmq.client.impl.MQClientAPIImpl.access$100(MQClientAPIImpl.java:228) at org.apache.rocketmq.client.impl.MQClientAPIImpl$2.onComplete(MQClientAPIImpl.java:863) at org.apache.rocketmq.client.impl.BaseInvokeCallback.operationComplete(BaseInvokeCallback.java:33) at org.apache.rocketmq.remoting.netty.NettyRemotingClient$InvokeCallbackWrapper.operationComplete(NettyRemotingClient.java:932) at org.apache.rocketmq.remoting.netty.ResponseFuture.executeInvokeCallback(ResponseFuture.java:62) at org.apache.rocketmq.remoting.netty.NettyRemotingAbstract.executeInvokeCallback(NettyRemotingAbstract.java:402) at org.apache.rocketmq.remoting.netty.NettyRemotingAbstract.processResponseCommand(NettyRemotingAbstract.java:364) at org.apache.rocketmq.remoting.netty.NettyRemotingAbstract.processMessageReceived(NettyRemotingAbstract.java:173) at org.apache.rocketmq.remoting.netty.NettyRemotingClient$NettyClientHandler.channelRead0(NettyRemotingClient.java:940) at org.apache.rocketmq.remoting.netty.NettyRemotingClient$NettyClientHandler.channelRead0(NettyRemotingClient.java:936) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61) at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370) at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at java.lang.Thread.run(Thread.java:750)` ### Steps to Reproduce 1. deploy namesrv, broker and proxy, using the latest version 2. continuously produce a certain number of messages 3. use gRPC clients to consume and return ConsumeResult.FAILURE randomly to mock consumption failure 4. then IndexOutOfBoundsException will be found at both client logs and proxy logs ### What Did You Expect to See? no exception ### What Did You See Instead? java.lang.IndexOutOfBoundsException thrown by clients `org.apache.rocketmq.client.java.exception.InternalErrorException: [request-id=60553936-c34b-471e-a24b-bd276a839362, response-code=50001] Index: 13, Size: 1. IndexOutOfBoundsException. java.util.ArrayList.rangeCheck(ArrayList.java:659) at org.apache.rocketmq.client.java.exception.StatusChecker.check(StatusChecker.java:90) at org.apache.rocketmq.client.java.impl.consumer.ConsumerImpl.lambda$receiveMessage$0(ConsumerImpl.java:113) at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:221) at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:208) at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:122) at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31) at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1270) at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1038) at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:783) at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:49) at org.apache.rocketmq.client.java.rpc.RpcClientImpl$1.onCompleted(RpcClientImpl.java:168) at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:485) at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:563) at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:744) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:723) at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750)` ### Additional Context _No response_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
