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 2020/05/27 03:26:07 UTC

[GitHub] [pulsar] fmiguelez opened a new issue #7046: NullPointerException with SubscriptionMode.NonDurable

fmiguelez opened a new issue #7046:
URL: https://github.com/apache/pulsar/issues/7046


   If we try to create a consumer with `SubscriptionMode.NonDurable`  it will fail with a `NullPointerException`.
   
   We try to mimic the behaviour of Reader with partitioned topics. 
   
   It can be reproduced this way:
   
   ```
   			final Consumer<T> consumer = client.newConsumer(schema).topic(topicUri)
   					.readCompacted(true)
   					.subscriptionMode(SubscriptionMode.NonDurable) 
                                           .subscriptionType(SubscriptionType.Exclusive)
                                           .subscriptionName(subscription)
   					.subscriptionInitialPosition(SubscriptionInitialPosition.Earliest)
                                           .subscribe();
   ```
   
   The exception throw is the following:
   
   ```
   	java.util.concurrent.CompletionException: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: java.lang.NullPointerException
   		at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292) ~[na:1.8.0_111]
   		at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308) ~[na:1.8.0_111]
   		at java.util.concurrent.CompletableFuture.biRelay(CompletableFuture.java:1284) ~[na:1.8.0_111]
   		at java.util.concurrent.CompletableFuture$BiRelay.tryFire(CompletableFuture.java:1270) ~[na:1.8.0_111]
   		at java.util.concurrent.CompletableFuture$CoCompletion.tryFire(CompletableFuture.java:1020) ~[na:1.8.0_111]
   		at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) ~[na:1.8.0_111]
   		at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977) ~[na:1.8.0_111]
   		at org.apache.pulsar.client.impl.ConsumerImpl.connectionFailed(ConsumerImpl.java:738) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.client.impl.ConnectionHandler.handleConnectionError(ConnectionHandler.java:78) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:870) ~[na:1.8.0_111]
   		at java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(CompletableFuture.java:852) ~[na:1.8.0_111]
   		at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) ~[na:1.8.0_111]
   		at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962) ~[na:1.8.0_111]
   		at org.apache.pulsar.client.impl.BinaryProtoLookupService.lambda$null$2(BinaryProtoLookupService.java:127) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:656) ~[na:1.8.0_111]
   		at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:632) ~[na:1.8.0_111]
   		at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) ~[na:1.8.0_111]
   		at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962) ~[na:1.8.0_111]
   		at org.apache.pulsar.client.impl.ClientCnx.handleLookupResponse(ClientCnx.java:480) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.common.protocol.PulsarDecoder.channelRead(PulsarDecoder.java:132) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.shade.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_111]
   	Caused by: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: java.lang.NullPointerException
   		... 33 common frames omitted
   	Caused by: java.util.concurrent.CompletionException: java.lang.NullPointerException
   		at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273) ~[na:1.8.0_111]
   		at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280) ~[na:1.8.0_111]
   		at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:659) ~[na:1.8.0_111]
   		at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:632) ~[na:1.8.0_111]
   		... 30 common frames omitted
   	Caused by: java.lang.NullPointerException: null
   		at org.apache.pulsar.client.impl.ConsumerImpl.connectionOpened(ConsumerImpl.java:586) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at org.apache.pulsar.client.impl.ConnectionHandler.lambda$grabCnx$0(ConnectionHandler.java:68) ~[pulsar-client-2.5.2.jar:2.5.2]
   		at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:656) ~[na:1.8.0_111]
   		... 31 common frames omitted		
   ```


----------------------------------------------------------------
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.

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



[GitHub] [pulsar] codelipenghui closed issue #7046: NullPointerException with SubscriptionMode.NonDurable

Posted by GitBox <gi...@apache.org>.
codelipenghui closed issue #7046:
URL: https://github.com/apache/pulsar/issues/7046


   


----------------------------------------------------------------
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.

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



[GitHub] [pulsar] 315157973 commented on issue #7046: NullPointerException with SubscriptionMode.NonDurable

Posted by GitBox <gi...@apache.org>.
315157973 commented on issue #7046:
URL: https://github.com/apache/pulsar/issues/7046#issuecomment-635882310


   Please assign it to me @sijie 


----------------------------------------------------------------
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.

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