Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ private void start() throws IOException {
// Some one has sent interrupt signal, this could be because
// 1. Trigger heartbeat immediately
// 2. Shutdown has be initiated.
LOG.warn("Interrupt the execution.", e);
Thread.currentThread().interrupt();
} catch (Exception e) {
LOG.error("Unable to finish the execution.", e);
Expand All @@ -242,7 +241,7 @@ private void start() throws IOException {
try {
Thread.sleep(nextHB.get() - now);
} catch (InterruptedException e) {
LOG.warn("Interrupt the execution.", e);
//triggerHeartbeat is called during the sleep
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I might misunderstand this: will then the InterruptedException silently be hidden? If so is this expected behavior?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Based on my understanding the interrupt is intentional (when DN would like to send out a HB immediately)

 /**
   * Calling this will immediately trigger a heartbeat to the SCMs.
   * This heartbeat will also include all the reports which are ready to
   * be sent by datanode.
   */
  public void triggerHeartbeat() {
    if (stateMachineThread != null) {
      stateMachineThread.interrupt();
    }
  }

I think it's expected to interrupt the thread, therefore we need to hide the exception.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it! Thanks for your clarification.

}
}
}
Expand Down