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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]