gaoshihang commented on code in PR #8000:
URL: https://github.com/apache/hudi/pull/8000#discussion_r1112481144


##########
hudi-common/src/main/java/org/apache/hudi/common/util/queue/DisruptorMessageQueue.java:
##########
@@ -100,6 +104,17 @@ public void seal() {}
   public void close() {
     synchronized (this) {
       if (!isShutdown) {
+        if (Thread.currentThread().isInterrupted()) {

Review Comment:
   updated



##########
hudi-common/src/main/java/org/apache/hudi/common/util/queue/DisruptorMessageQueue.java:
##########
@@ -100,6 +104,17 @@ public void seal() {}
   public void close() {
     synchronized (this) {
       if (!isShutdown) {
+        if (Thread.currentThread().isInterrupted()) {
+          // if current thread has been interrupted, we still give executor a 
chance to proceeding.
+          LOG.error("Disruptor Queue has been interrupted! Shutdown now.");
+          try {
+            queue.shutdown(TIMEOUT_WAITING_SECS, TimeUnit.SECONDS);
+          } catch (TimeoutException e) {
+            LOG.error("Disruptor Queue has been interrupted: " + e);
+            throw new HoodieException(e);
+          }
+          throw new HoodieException("Disruptor Queue has been interrupted! 
Shutdown now.");
+        }
         isShutdown = true;
         isStarted = false;
         queue.shutdown();

Review Comment:
   updated



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