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 @@ -55,6 +55,7 @@

import com.google.common.annotations.VisibleForTesting;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import org.apache.ratis.util.ExitUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -410,6 +411,11 @@ public void startDaemon() {
stateMachineThread = new ThreadFactoryBuilder()
.setDaemon(true)
.setNameFormat("Datanode State Machine Thread - %d")
.setUncaughtExceptionHandler((Thread t, Throwable ex) -> {
String message = "Terminate Datanode, encounter uncaught exception"
+ " in Datanode State Machine Thread";
ExitUtils.terminate(1, message, ex, LOG);
})
.build().newThread(startStateMachineTask);
stateMachineThread.start();
}
Expand Down