You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/02/22 06:38:35 UTC

[GitHub] [pulsar] Jason918 opened a new pull request #14410: [broker] Fix IllegalStateException in ServerCnx#handleRedeliverUnacknowledged

Jason918 opened a new pull request #14410:
URL: https://github.com/apache/pulsar/pull/14410


   
   
   ### Motivation
   
   Test case `SimpleProducerConsumerTest#testBlockUnackedConsumerRedeliverySpecificMessagesProduceWithPause` fails with debug log enabled.
   
   Root cause is that `redeliver.getConsumerEpoch()`  used in debug log without check if it's set.
   
   ```
   2022-02-22T13:13:09,216+0800 [pulsar-io-6-1] WARN  ServerCnx - [/127.0.0.1:64428] Got exception java.lang.IllegalStateException: Field 'consumer_epoch' is not set
   	at org.apache.pulsar.common.api.proto.CommandRedeliverUnacknowledgedMessages.getConsumerEpoch(CommandRedeliverUnacknowledgedMessages.java:87)
   	at org.apache.pulsar.broker.service.ServerCnx.handleRedeliverUnacknowledged(ServerCnx.java:1559)
   	at org.apache.pulsar.common.protocol.PulsarDecoder.channelRead(PulsarDecoder.java:274)
   	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.flow.FlowControlHandler.dequeue(FlowControlHandler.java:200)
   	at io.netty.handler.flow.FlowControlHandler.channelRead(FlowControlHandler.java:162)
   	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:327)
   	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:299)
   	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.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
   	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
   	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
   	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
   	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
   	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
   	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
   	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
   	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
   	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
   	at java.base/java.lang.Thread.run(Thread.java:829)
   ```
   
   ### Modifications
   
   Add check before get.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change is a trivial rework / code cleanup without any test coverage.
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   
   Check the box below and label this PR (if you have committer privilege).
   
   Need to update docs? 
     
   - [x] `no-need-doc` 
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] michaeljmarshall commented on pull request #14410: [broker] Fix IllegalStateException in ServerCnx#handleRedeliverUnacknowledged

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on pull request #14410:
URL: https://github.com/apache/pulsar/pull/14410#issuecomment-1048429894


   @Jason918 - I believe he is referring to this PR https://github.com/apache/pulsar/pull/12899, and possibly others.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] michaeljmarshall merged pull request #14410: [broker] Fix IllegalStateException in ServerCnx#handleRedeliverUnacknowledged

Posted by GitBox <gi...@apache.org>.
michaeljmarshall merged pull request #14410:
URL: https://github.com/apache/pulsar/pull/14410


   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] Jason918 commented on pull request #14410: [broker] Fix IllegalStateException in ServerCnx#handleRedeliverUnacknowledged

Posted by GitBox <gi...@apache.org>.
Jason918 commented on pull request #14410:
URL: https://github.com/apache/pulsar/pull/14410#issuecomment-1047702943


   > By the way this is not a big deal, it is only a matter of patience.
   
   Do you mean we have solutions to solve similar ISE once for all? Any PRs?


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] michaeljmarshall commented on pull request #14410: [broker] Fix IllegalStateException in ServerCnx#handleRedeliverUnacknowledged

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on pull request #14410:
URL: https://github.com/apache/pulsar/pull/14410#issuecomment-1048449818


   @codelipenghui - great point. I didn't realize this was for a new field.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] Jason918 edited a comment on pull request #14410: [broker] Fix IllegalStateException in ServerCnx#handleRedeliverUnacknowledged

Posted by GitBox <gi...@apache.org>.
Jason918 edited a comment on pull request #14410:
URL: https://github.com/apache/pulsar/pull/14410#issuecomment-1047702943


   > By the way this is not a big deal, it is only a matter of patience.
   
   @eolivelli Do you mean we have solutions to solve similar ISE once for all? Any PRs?


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on pull request #14410: [broker] Fix IllegalStateException in ServerCnx#handleRedeliverUnacknowledged

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on pull request #14410:
URL: https://github.com/apache/pulsar/pull/14410#issuecomment-1048437487


   I believe this one needs to be contained in the 2.10.0 release, otherwise, if upgrade the broker to 2.10.0 but the client still using 2.9.x or 2.8.x, the issue will happen.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] eolivelli commented on pull request #14410: [broker] Fix IllegalStateException in ServerCnx#handleRedeliverUnacknowledged

Posted by GitBox <gi...@apache.org>.
eolivelli commented on pull request #14410:
URL: https://github.com/apache/pulsar/pull/14410#issuecomment-1047479317


   Good catch.
   Unfortunately we already found similar cases after the migration to lightproto. 
   
   By the way this is not a big deal, it is only a matter of patience. 
   I prefer to see these ISE when accessing bad fields


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org