You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "boneanxs (via GitHub)" <gi...@apache.org> on 2023/03/29 07:39:51 UTC

[GitHub] [hudi] boneanxs commented on a diff in pull request #4264: [HUDI-2875] Make HoodieParquetWriter Thread safe and memory executor …

boneanxs commented on code in PR #4264:
URL: https://github.com/apache/hudi/pull/4264#discussion_r1151515447


##########
hudi-common/src/main/java/org/apache/hudi/common/util/queue/BoundedInMemoryExecutor.java:
##########
@@ -168,6 +169,27 @@ public boolean isRemaining() {
   public void shutdownNow() {
     producerExecutorService.shutdownNow();
     consumerExecutorService.shutdownNow();
+    // close queue to force producer stop
+    queue.close();
+  }
+
+  public boolean awaitTermination() {
+    // if current thread has been interrupted before awaitTermination was called, we still give
+    // executor a chance to proceeding. So clear the interrupt flag and reset it if needed before return.
+    boolean interruptedBefore = Thread.interrupted();

Review Comment:
   Hi @guanziyue Since we always call `shutdownNow` before `awaitTermination`, here why we need to clear `interrupt` status and await producer&consumer terminated? They should already shutdown by `shutdownNow` before?



-- 
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@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org