mirror of
https://github.com/actiontech/dble.git
synced 2026-01-10 06:40:18 -06:00
fix bug that dble can't start in performance mode (#2268)
* fix hang in performance mode * fix currentResponseService
This commit is contained in:
@@ -238,20 +238,29 @@ public class MySQLBackAuthService extends AuthService {
|
||||
|
||||
@Override
|
||||
public void taskToTotalQueue(ServiceTask task) {
|
||||
Executor executor = DbleServer.getInstance().getBackendBusinessExecutor();
|
||||
if (isHandling.compareAndSet(false, true)) {
|
||||
executor.execute(() -> {
|
||||
try {
|
||||
handleInnerData();
|
||||
} catch (Exception e) {
|
||||
handleDataError(e);
|
||||
} finally {
|
||||
isHandling.set(false);
|
||||
if (taskQueue.size() > 0) {
|
||||
taskToTotalQueue(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
if (SystemConfig.getInstance().getUsePerformanceMode() == 1) {
|
||||
if (isHandling.compareAndSet(false, true)) {
|
||||
DbleServer.getInstance().getConcurrentBackHandlerQueue().offer(task);
|
||||
}
|
||||
} else {
|
||||
Executor executor = DbleServer.getInstance().getBackendBusinessExecutor();
|
||||
if (isHandling.compareAndSet(false, true)) {
|
||||
executor.execute(this::consumerInternalData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void consumerInternalData() {
|
||||
try {
|
||||
handleInnerData();
|
||||
} catch (Exception e) {
|
||||
handleDataError(e);
|
||||
} finally {
|
||||
isHandling.set(false);
|
||||
if (taskQueue.size() > 0) {
|
||||
taskToTotalQueue(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,13 +25,17 @@ public class MySQLCurrentResponseService extends MySQLResponseService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void consumerInternalData() {
|
||||
try {
|
||||
super.handleInnerData();
|
||||
handleInnerData();
|
||||
} catch (Exception e) {
|
||||
handleDataError(e);
|
||||
} finally {
|
||||
isHandling.set(false);
|
||||
if (taskQueue.size() > 0) {
|
||||
taskToTotalQueue(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user