Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[inner-2362] disable kill and recover operations on NIOFrontRW threads #3824

Merged
merged 1 commit into from
Sep 21, 2023
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
19 changes: 6 additions & 13 deletions src/main/java/com/actiontech/dble/singleton/ThreadManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public static void interruptSingleThread(String threadName) throws Exception {
}
if (find == null)
throw new Exception("Thread[" + threadName + "] does not exist");

String[] array = threadName.split("-");
if (array.length == 2 && array[1].equals(NIO_FRONT_RW)) {
throw new Exception("The kill operation of thread[" + threadName + "] is not supported");
}
find.interrupt();
LOGGER.info("exec interrupt Thread[{}]", find.getName());
}
Expand Down Expand Up @@ -87,19 +92,7 @@ public static void recoverSingleThread(String threadName) throws Exception {
}
break;
case NIO_FRONT_RW:
if (SystemConfig.getInstance().getUsingAIO() != 1) {
try {
NameableExecutor nameableExecutor4 = (NameableExecutor) server.getNioFrontExecutor();
if (nameableExecutor4.getPoolSize() > nameableExecutor4.getActiveCount()) {
nameableExecutor4.execute(new RW(server.getFrontRegisterQueue()));
} else {
throw new Exception("threadPool[{" + NIO_FRONT_RW + "}] does not need to be recover");
}
} catch (IOException e) {
throw new Exception("recover threadPool[{" + NIO_FRONT_RW + "}] fail", e);
}
}
break;
throw new Exception("The recover operation of thread[" + threadName + "] is not supported");
case NIO_BACKEND_RW:
if (SystemConfig.getInstance().getUsingAIO() != 1) {
try {
Expand Down
Loading