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/06/23 02:17:40 UTC

[GitHub] [pulsar] nodece commented on a diff in pull request #16183: Use ExecutorService.execute() instead of submit() when possible

nodece commented on code in PR #16183:
URL: https://github.com/apache/pulsar/pull/16183#discussion_r904457887


##########
tiered-storage/file-system/src/main/java/org/apache/bookkeeper/mledger/offload/filesystem/impl/FileStoreBackedReadHandleImpl.java:
##########
@@ -90,9 +90,10 @@ public LedgerMetadata getLedgerMetadata() {
     @Override
     public CompletableFuture<Void> closeAsync() {
         CompletableFuture<Void> promise = new CompletableFuture<>();
-        executor.submit(() -> {
+        executor.execute(() -> {
                 try {
                     reader.close();
+                    promise.complete(null);

Review Comment:
   The promise is complete in line 145.



##########
tiered-storage/file-system/src/main/java/org/apache/bookkeeper/mledger/offload/filesystem/impl/FileStoreBackedReadHandleImpl.java:
##########
@@ -90,9 +90,10 @@ public LedgerMetadata getLedgerMetadata() {
     @Override
     public CompletableFuture<Void> closeAsync() {
         CompletableFuture<Void> promise = new CompletableFuture<>();
-        executor.submit(() -> {
+        executor.execute(() -> {
                 try {
                     reader.close();
+                    promise.complete(null);

Review Comment:
   The promise is complete in line 144.



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