merlimat commented on a change in pull request #11387:
URL: https://github.com/apache/pulsar/pull/11387#discussion_r696987788



##########
File path: 
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpReadEntry.java
##########
@@ -141,8 +141,8 @@ void checkReadCompletion() {
                 cursor.ledger.startReadOperationOnLedger(nextReadPosition, 
OpReadEntry.this);
             }
 
-            // Schedule next read in a different thread
-            cursor.ledger.getExecutor().execute(safeRun(() -> {
+            // Schedule next read
+            cursor.ledger.getPinnedExecutor().execute(safeRun(() -> {

Review comment:
       > Wouldn't the usage of the pinned executor achieve the same result? It 
prevents the stack from going deeper and >deeper.
   > Why would it have to jump to a random thread to break the chain?
   
   @lhotari Uhm, I think that some executors are short-circuiting the queue if 
they detect that you're trying to add a task from the same executor thread. 
That is the case for Netty IO thread, though I just check that it shouldn't 
happen on the `ThreadPoolExecutor` on which the OrderedExecutor is based upon.
   




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