提交 380065e5 编写于 作者: X xywang

[TD-11377]<feature>: added a variable to accelerate exiting of dropped dnode

上级 43abbcbf
......@@ -19,6 +19,7 @@
#include "tconfig.h"
#include "dnodeMain.h"
bool dnodeExit = false;
static tsem_t exitSem;
static void siguser1Handler(int32_t signum, void *sigInfo, void *context);
static void siguser2Handler(int32_t signum, void *sigInfo, void *context);
......@@ -182,6 +183,8 @@ static void sigintHandler(int32_t signum, void *sigInfo, void *context) {
syslog(LOG_INFO, "Shut down signal is %d", signum);
syslog(LOG_INFO, "Shutting down TDengine service...");
dnodeExit = true;
// inform main thread to exit
tsem_post(&exitSem);
#ifdef WINDOWS
......
......@@ -30,6 +30,7 @@ typedef struct {
int32_t * vnodeList;
} SOpenVnodeThread;
extern bool dnodeExit;
extern void * tsDnodeTmr;
static void * tsStatusTimer = NULL;
static uint32_t tsRebootTime = 0;
......@@ -225,6 +226,11 @@ static void dnodeProcessStatusRsp(SRpcMsg *pMsg) {
// warning: only for k8s!
while (tsDnodeNopLoop) {
if (dnodeExit) {
dInfo("Break loop");
return;
}
dInfo("Nop loop");
#ifdef WINDOWS
Sleep(100);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册