lhotari commented on pull request #14320:
URL: https://github.com/apache/pulsar/pull/14320#issuecomment-1042752949


   > When an admin API calls the ZK metadatastore API, it gets the ZK data by 
call the `CompletableFuture`, note that we did not use the executor to execute 
the `CompletableFuture#complete()` in 
[ZKMetadataStore.java#L171](https://github.com/apache/pulsar/blob/master/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/ZKMetadataStore.java#L171).
 In ZK callback thread, once the caller converts async to sync calls then the 
ZK callback thread will be blocked, this code so like: 
`metadata.getAsync().get(30, TimeUnit.SECONDS)`.
   
   The blocked thread in #13666 is a HTTP server thread.
   
   ```
   "pulsar-web-40-28" #238 prio=5 os_prio=0 tid=0x00007f5a4000d800 nid=0x2bcf 
waiting on condition [0x00007f5961d3b000]
      java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000005c5529d40> (a 
java.util.concurrent.CompletableFuture$Signaller)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at 
java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1693)
        at 
java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3323)
        at 
java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1729)
        at 
java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
        at 
org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalDeleteSubscriptionForNonPartitionedTopic(PersistentTopicsBase.java:1498)
   ```
   
   I'll clarify what I have been referring to as "sync -> async" changes: 
changes where the use of the blocking Servlet API is migrated to use 
Asynchronous Servlet API.
   I understand that it's necessary to not block in Zookeeper callbacks, but 
that is a different problem, which isn't related to Servlet API change.
   
   
   
   
   


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


Reply via email to