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

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

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