Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e1660a12
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e1660a12
编写于
4月 01, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
shm
上级
c3917c25
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
12 addition
and
14 deletion
+12
-14
source/dnode/mgmt/main/exe/dndMain.c
source/dnode/mgmt/main/exe/dndMain.c
+3
-2
source/dnode/mgmt/main/src/dndExec.c
source/dnode/mgmt/main/src/dndExec.c
+8
-2
source/dnode/mgmt/main/src/dndInt.c
source/dnode/mgmt/main/src/dndInt.c
+0
-9
source/os/src/osSignal.c
source/os/src/osSignal.c
+1
-1
未找到文件。
source/dnode/mgmt/main/exe/dndMain.c
浏览文件 @
e1660a12
...
...
@@ -30,7 +30,6 @@ static struct {
}
global
=
{
0
};
static
void
dndStopDnode
(
int
signum
,
void
*
info
,
void
*
ctx
)
{
dInfo
(
"system signal:%d received"
,
signum
);
SDnode
*
pDnode
=
atomic_val_compare_exchange_ptr
(
&
global
.
pDnode
,
0
,
global
.
pDnode
);
if
(
pDnode
!=
NULL
)
{
dndHandleEvent
(
pDnode
,
DND_EVENT_STOP
);
...
...
@@ -41,8 +40,10 @@ static void dndSetSignalHandle() {
taosSetSignal
(
SIGTERM
,
dndStopDnode
);
taosSetSignal
(
SIGHUP
,
dndStopDnode
);
taosSetSignal
(
SIGINT
,
dndStopDnode
);
taosSetSignal
(
SIGTSTP
,
dndStopDnode
);
taosSetSignal
(
SIGABRT
,
dndStopDnode
);
taosSetSignal
(
SIGBREAK
,
dndStopDnode
);
taosSetSignal
(
SIGQUIT
,
dndStopDnode
);
if
(
!
tsMultiProcess
)
{
}
else
if
(
global
.
ntype
==
DNODE
||
global
.
ntype
==
NODE_MAX
)
{
...
...
@@ -72,7 +73,7 @@ static int32_t dndParseArgs(int32_t argc, char const *argv[]) {
}
else
if
(
strcmp
(
argv
[
i
],
"-n"
)
==
0
)
{
global
.
ntype
=
atoi
(
argv
[
++
i
]);
if
(
global
.
ntype
<=
DNODE
||
global
.
ntype
>
NODE_MAX
)
{
printf
(
"'-n' range is [1
-5], default is 0
\n
"
);
printf
(
"'-n' range is [1
- %d], default is 0
\n
"
,
NODE_MAX
-
1
);
return
-
1
;
}
}
else
if
(
strcmp
(
argv
[
i
],
"-k"
)
==
0
)
{
...
...
source/dnode/mgmt/main/src/dndExec.c
浏览文件 @
e1660a12
...
...
@@ -180,6 +180,7 @@ static int32_t dndRunInSingleProcess(SDnode *pDnode) {
while
(
1
)
{
if
(
pDnode
->
event
==
DND_EVENT_STOP
)
{
dInfo
(
"dnode is about to stop"
);
dndSetStatus
(
pDnode
,
DND_STAT_STOPPED
);
break
;
}
taosMsleep
(
100
);
...
...
@@ -255,14 +256,16 @@ static int32_t dndRunInParentProcess(SDnode *pDnode) {
while
(
1
)
{
if
(
pDnode
->
event
==
DND_EVENT_STOP
)
{
dInfo
(
"dnode is about to stop"
);
dndSetStatus
(
pDnode
,
DND_STAT_STOPPED
);
for
(
ENodeType
n
=
DNODE
+
1
;
n
<
NODE_MAX
;
++
n
)
{
SMgmtWrapper
*
pWrapper
=
&
pDnode
->
wrappers
[
n
];
if
(
!
pWrapper
->
required
)
continue
;
if
(
pDnode
->
ntype
==
NODE_MAX
)
continue
;
if
(
pWrapper
->
procId
>
0
&&
taosProcExist
(
pWrapper
->
procId
))
{
//
dInfo("node:%s, send kill signal to the child process:%d", pWrapper->name, pWrapper->procId);
//
taosKillProc(pWrapper->procId);
dInfo
(
"node:%s, send kill signal to the child process:%d"
,
pWrapper
->
name
,
pWrapper
->
procId
);
taosKillProc
(
pWrapper
->
procId
);
dInfo
(
"node:%s, wait for child process:%d to stop"
,
pWrapper
->
name
,
pWrapper
->
procId
);
taosWaitProc
(
pWrapper
->
procId
);
dInfo
(
"node:%s, child process:%d is stopped"
,
pWrapper
->
name
,
pWrapper
->
procId
);
...
...
@@ -332,10 +335,13 @@ static int32_t dndRunInChildProcess(SDnode *pDnode) {
while
(
1
)
{
if
(
pDnode
->
event
==
DND_EVENT_STOP
)
{
dInfo
(
"%s is about to stop"
,
pWrapper
->
name
);
dndSetStatus
(
pDnode
,
DND_STAT_STOPPED
);
break
;
}
taosMsleep
(
100
);
}
return
0
;
}
int32_t
dndRun
(
SDnode
*
pDnode
)
{
...
...
source/dnode/mgmt/main/src/dndInt.c
浏览文件 @
e1660a12
...
...
@@ -133,14 +133,6 @@ _OVER:
void
dndClose
(
SDnode
*
pDnode
)
{
if
(
pDnode
==
NULL
)
return
;
if
(
dndGetStatus
(
pDnode
)
==
DND_STAT_STOPPED
)
{
dError
(
"dnode is shutting down, data:%p"
,
pDnode
);
return
;
}
dInfo
(
"start to close dnode, data:%p"
,
pDnode
);
dndSetStatus
(
pDnode
,
DND_STAT_STOPPED
);
for
(
ENodeType
n
=
0
;
n
<
NODE_MAX
;
++
n
)
{
SMgmtWrapper
*
pWrapper
=
&
pDnode
->
wrappers
[
n
];
dndCloseNode
(
pWrapper
);
...
...
@@ -151,7 +143,6 @@ void dndClose(SDnode *pDnode) {
}
void
dndHandleEvent
(
SDnode
*
pDnode
,
EDndEvent
event
)
{
dInfo
(
"dnode receive %s event, data:%p"
,
dndEventStr
(
event
),
pDnode
);
if
(
event
==
DND_EVENT_STOP
)
{
pDnode
->
event
=
event
;
}
...
...
source/os/src/osSignal.c
浏览文件 @
e1660a12
...
...
@@ -59,7 +59,7 @@ void taosSetSignal(int32_t signum, FSignalHandler sigfp) {
struct
sigaction
act
;
memset
(
&
act
,
0
,
sizeof
(
act
));
#if 1
act
.
sa_flags
=
SA_SIGINFO
;
act
.
sa_flags
=
SA_SIGINFO
|
SA_RESTART
;
act
.
sa_sigaction
=
(
FLinuxSignalHandler
)
sigfp
;
#else
act
.
sa_handler
=
sigfp
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录