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/04/26 15:44:56 UTC

[GitHub] [pulsar] eolivelli opened a new pull request, #15335: PIP-105: Fix error on recycled SubscriptionPropertiesList

eolivelli opened a new pull request, #15335:
URL: https://github.com/apache/pulsar/pull/15335

   ### Motivation
   
   Sometimes the CommandSubscribe object has already been released and it triggers this error:
   
   > 17:36:40.676 [bookkeeper-ml-scheduler-OrderedScheduler-3-0] WARN  org.apache.pulsar.broker.service.ServerCnx - [/192.168.1.111:50688][persistent://public/default/test-cb4105f6-f850-4bdf-9e79-66d4ac42658c][13b9ee68-4ee4-4845-b955-77420b8b6a29] Failed to create consumer: consumerId=0, refCnt: 0
   > java.util.concurrent.CompletionException: io.netty.util.IllegalReferenceCountException: refCnt: 0
   > 	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314) ~[?:?]
   > 	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319) ~[?:?]
   > 	at java.util.concurrent.CompletableFuture.tryFire(CompletableFuture.java:1081) ~[?:?]
   > 	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[?:?]
   > 	at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073) ~[?:?]
   > 	at org.apache.pulsar.broker.service.BrokerService.lambda(BrokerService.java:1419) ~[pulsar-broker-2.10.0.jar:2.10.0]
   > 	at java.util.concurrent.CompletableFuture.uniRunNow(CompletableFuture.java:815) ~[?:?]
   > 	at java.util.concurrent.CompletableFuture.uniRunStage(CompletableFuture.java:799) ~[?:?]
   > 	at java.util.concurrent.CompletableFuture.thenRun(CompletableFuture.java:2121) ~[?:?]
   > 	at org.apache.pulsar.broker.service.BrokerService.openLedgerComplete(BrokerService.java:1405) ~[pulsar-broker-2.10.0.jar:2.10.0]
   > 	at org.apache.bookkeeper.mledger.impl.ManagedLedgerFactoryImpl.lambda(ManagedLedgerFactoryImpl.java:425) ~[managed-ledger-2.10.0.jar:2.10.0]
   > 	at java.util.concurrent.CompletableFuture.tryFire2168(CompletableFuture.java:714) ~[?:?]
   > 	at java.util.concurrent.CompletableFuture.tryFire(CompletableFuture.java) ~[?:?]
   > 	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[?:?]
   > 	at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073) ~[?:?]
   > 	at org.apache.bookkeeper.mledger.impl.ManagedLedgerFactoryImpl.initializeComplete(ManagedLedgerFactoryImpl.java:392) ~[managed-ledger-2.10.0.jar:2.10.0]
   > 	at org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.operationComplete(ManagedLedgerImpl.java:525) ~[managed-ledger-2.10.0.jar:2.10.0]
   > 	at org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.operationComplete(ManagedLedgerImpl.java:515) ~[managed-ledger-2.10.0.jar:2.10.0]
   > 	at org.apache.bookkeeper.mledger.impl.MetaStoreImpl.lambda(MetaStoreImpl.java:167) ~[managed-ledger-2.10.0.jar:2.10.0]
   > 	at java.util.concurrent.CompletableFuture.tryFire2168(CompletableFuture.java:714) [?:?]
   > 	at java.util.concurrent.CompletableFuture.tryFire(CompletableFuture.java) [?:?]
   > 	at java.util.concurrent.CompletableFuture.run(CompletableFuture.java:478) [?:?]
   > 	at org.apache.bookkeeper.common.util.OrderedExecutor.run(OrderedExecutor.java:203) [bookkeeper-common-4.14.4.jar:4.14.4]
   > 	at java.util.concurrent.Executors.call(Executors.java:515) [?:?]
   > 	at java.util.concurrent.FutureTask.run2168(FutureTask.java:264) [?:?]
   > 	at java.util.concurrent.FutureTask.run(FutureTask.java) [?:?]
   > 	at java.util.concurrent.ScheduledThreadPoolExecutor.run(ScheduledThreadPoolExecutor.java:304) [?:?]
   > 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
   > 	at java.util.concurrent.ThreadPoolExecutor.run(ThreadPoolExecutor.java:628) [?:?]
   > 	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.74.Final.jar:4.1.74.Final]
   > 	at java.lang.Thread.run(Thread.java:829) [?:?]
   > Caused by: io.netty.util.IllegalReferenceCountException: refCnt: 0
   > 	at io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1454) ~[netty-buffer-4.1.74.Final.jar:4.1.74.Final]
   > 	at io.netty.buffer.AbstractByteBuf.checkIndex(AbstractByteBuf.java:1383) ~[netty-buffer-4.1.74.Final.jar:4.1.74.Final]
   > 	at io.netty.buffer.UnsafeByteBufUtil.getBytes(UnsafeByteBufUtil.java:481) ~[netty-buffer-4.1.74.Final.jar:4.1.74.Final]
   > 	at io.netty.buffer.PooledUnsafeDirectByteBuf.getBytes(PooledUnsafeDirectByteBuf.java:130) ~[netty-buffer-4.1.74.Final.jar:4.1.74.Final]
   > 	at io.netty.buffer.PooledSlicedByteBuf.getBytes(PooledSlicedByteBuf.java:235) ~[netty-buffer-4.1.74.Final.jar:4.1.74.Final]
   > 	at io.netty.buffer.ByteBufUtil.decodeString(ByteBufUtil.java:1270) ~[netty-buffer-4.1.74.Final.jar:4.1.74.Final]
   > 	at io.netty.buffer.AbstractByteBuf.toString(AbstractByteBuf.java:1246) ~[netty-buffer-4.1.74.Final.jar:4.1.74.Final]
   > 	at org.apache.pulsar.common.api.proto.LightProtoCodec.readString(LightProtoCodec.java:250) ~[pulsar-common-2.10.0.jar:2.10.0]
   > 	at org.apache.pulsar.common.api.proto.KeyValue.getKey(KeyValue.java:19) ~[pulsar-common-2.10.0.jar:2.10.0]
   > 	at java.util.stream.Collectors.lambda(Collectors.java:1658) ~[?:?]
   > 	at java.util.stream.ReduceOpsReducingSink.accept(ReduceOps.java:169) ~[?:?]
   > 	at java.util.ArrayList.forEachRemaining(ArrayList.java:1511) ~[?:?]
   > 	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?]
   > 	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?]
   > 	at java.util.stream.ReduceOps.evaluateSequential(ReduceOps.java:913) ~[?:?]
   > 	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
   > 	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[?:?]
   > 	at org.apache.pulsar.broker.service.SubscriptionOption.getPropertiesMap(SubscriptionOption.java:57) ~[pulsar-broker-2.10.0.jar:2.10.0]
   > 	at org.apache.pulsar.broker.service.ServerCnx.lambda(ServerCnx.java:1047) ~[pulsar-broker-2.10.0.jar:2.10.0]
   > 	at java.util.concurrent.CompletableFuture.tryFire(CompletableFuture.java:1072) ~[?:?]
   > 	... 28 more
   
   ### Modifications
   
   Capture the fields in the main thread
   
   ### Verifying this change
   
   This change is a trivial rework / code cleanup without any test coverage.
   


-- 
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] Anonymitaet commented on pull request #15335: PIP-105: Fix error on recycled SubscriptionPropertiesList

Posted by GitBox <gi...@apache.org>.
Anonymitaet commented on PR #15335:
URL: https://github.com/apache/pulsar/pull/15335#issuecomment-1110444030

   @eolivelli looks like we do not need to update docs for this PR?


-- 
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 #15335: PIP-105: Fix error on recycled SubscriptionPropertiesList

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

   it happens for instance when you auto-create the topic during the suscription, in this case the code is executed in a different thread


-- 
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] github-actions[bot] commented on pull request #15335: PIP-105: Fix error on recycled SubscriptionPropertiesList

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #15335:
URL: https://github.com/apache/pulsar/pull/15335#issuecomment-1109958092

   @eolivelli:Thanks for your contribution. For this PR, do we need to update docs?
   (The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)


-- 
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] github-actions[bot] commented on pull request #15335: PIP-105: Fix error on recycled SubscriptionPropertiesList

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #15335:
URL: https://github.com/apache/pulsar/pull/15335#issuecomment-1109958116

   @eolivelli:Thanks for your contribution. For this PR, do we need to update docs?
   (The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)


-- 
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 #15335: PIP-105: Fix error on recycled SubscriptionPropertiesList

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

   It is quite hard to add a test, the feature is already covered (it is PIP-105)


-- 
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 #15335: PIP-105: Fix error on recycled SubscriptionPropertiesList

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

   > @eolivelli looks like we do not need to update docs for this PR?
   
   we don't need. I added the label. thanks for the reminder


-- 
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 merged pull request #15335: PIP-105: Fix error on recycled SubscriptionPropertiesList

Posted by GitBox <gi...@apache.org>.
eolivelli merged PR #15335:
URL: https://github.com/apache/pulsar/pull/15335


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