BewareMyPower commented on code in PR #21091:
URL: https://github.com/apache/pulsar/pull/21091#discussion_r1312643008


##########
pulsar-broker/src/main/java/org/apache/pulsar/compaction/StrategicTwoPhaseCompactor.java:
##########
@@ -377,7 +356,7 @@ private <T> CompletableFuture<Long> runPhaseTwo(
                                     return;
                                 }
                             });
-                })
+                }, scheduler)

Review Comment:
   Is there any case when `loopPromise` is not completed in the `scheduler`? In 
`phaseTwoLoop`:
   
   ```java
           CompletableFuture.runAsync(() -> {
                       if (reader.hasNext()) {
                           /* ... */
                       } else {
                           promise.complete(null);
                           return;
                       }
                   }, scheduler)
   ```
   
   `promise.complete(null);` is called in the `scheduler`, I think we can 
immediately execute the callback of `thenCompose` instead adding the callback 
again to `scheduler`.



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