zymap opened a new issue #9032:
URL: https://github.com/apache/pulsar/issues/9032


   **Describe the bug**
   When using pulsar-admin to clear a backlog, the pulsar-admin is hanging.
   I use the pulsar-admin to create a subscription then using the pulsar-admin
   to clear the backlog, pulsar admin is hanging and the broker has NPE.
   
   **To Reproduce**
   1. Build the master code
   2. Start a standalone service: 
   ```
   bin/pulsar standalone -nss -nfw
   ```
   3. Create a subscription:
   ```
   bin/pulsar-admin topics create-subscription -s test1 test1
   ```
   4. Clear the backlog:
   ```
   bin/pulsar-admin topics clear-backlog -s test1 test1
   ```
   
   **Expected behavior**
   An error returned or has detailed information about the operations.
   
   **Additional**
   Broker log:
   ```
   11:20:19.751 [BookKeeperClientWorker-OrderedExecutor-1-0] ERROR 
org.apache.bookkeeper.common.util.SafeRunnable - Unexpected throwable caught
   java.lang.NullPointerException: null
        at 
org.apache.pulsar.broker.service.persistent.PersistentSubscription$4.clearBacklogComplete(PersistentSubscription.java:504)
 ~[pulsar-broker.jar:2.8.0-SNAPSHOT]
        at 
org.apache.bookkeeper.mledger.impl.ManagedCursorImpl$14.markDeleteComplete(ManagedCursorImpl.java:1363)
 ~[managed-ledger.jar:2.8.0-SNAPSHOT]
        at 
org.apache.bookkeeper.mledger.impl.ManagedCursorImpl$17.operationComplete(ManagedCursorImpl.java:1732)
 ~[managed-ledger.jar:2.8.0-SNAPSHOT]
        at 
org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.lambda$persistPositionToLedger$21(ManagedCursorImpl.java:2509)
 ~[managed-ledger.jar:2.8.0-SNAPSHOT]
        at 
org.apache.bookkeeper.client.AsyncCallback$AddCallback.addCompleteWithLatency(AsyncCallback.java:92)
 ~[bookkeeper-server-4.12.0.jar:4.12.0]
        at 
org.apache.bookkeeper.client.PendingAddOp.submitCallback(PendingAddOp.java:431) 
~[bookkeeper-server-4.12.0.jar:4.12.0]
        at 
org.apache.bookkeeper.client.LedgerHandle.sendAddSuccessCallbacks(LedgerHandle.java:1832)
 ~[bookkeeper-server-4.12.0.jar:4.12.0]
        at 
org.apache.bookkeeper.client.PendingAddOp.sendAddSuccessCallbacks(PendingAddOp.java:415)
 ~[bookkeeper-server-4.12.0.jar:4.12.0]
        at 
org.apache.bookkeeper.client.PendingAddOp.writeComplete(PendingAddOp.java:409) 
~[bookkeeper-server-4.12.0.jar:4.12.0]
        at 
org.apache.bookkeeper.proto.PerChannelBookieClient$AddCompletion.writeComplete(PerChannelBookieClient.java:2149)
 ~[bookkeeper-server-4.12.0.jar:4.12.0]
        at 
org.apache.bookkeeper.proto.PerChannelBookieClient$AddCompletion.handleResponse(PerChannelBookieClient.java:2206)
 ~[bookkeeper-server-4.12.0.jar:4.12.0]
        at 
org.apache.bookkeeper.proto.PerChannelBookieClient$AddCompletion.handleV2Response(PerChannelBookieClient.java:2185)
 ~[bookkeeper-server-4.12.0.jar:4.12.0]
        at 
org.apache.bookkeeper.proto.PerChannelBookieClient$ReadV2ResponseCallback.safeRun(PerChannelBookieClient.java:1380)
 ~[bookkeeper-server-4.12.0.jar:4.12.0]
        at 
org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36) 
[bookkeeper-common-4.12.0.jar:4.12.0]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
[?:1.8.0_201]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
[?:1.8.0_201]
        at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
 [netty-common-4.1.51.Final.jar:4.1.51.Final]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
   ```
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to