Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
33228ee5
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
33228ee5
编写于
1月 22, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1207
上级
d997745d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
24 addition
and
12 deletion
+24
-12
src/dnode/src/dnodeSystem.c
src/dnode/src/dnodeSystem.c
+10
-6
src/kit/shell/src/shellMain.c
src/kit/shell/src/shellMain.c
+1
-1
src/os/inc/osSignal.h
src/os/inc/osSignal.h
+1
-1
src/os/src/detail/osSignal.c
src/os/src/detail/osSignal.c
+6
-0
src/os/src/windows/wSignal.c
src/os/src/windows/wSignal.c
+3
-1
src/sync/src/syncArbitrator.c
src/sync/src/syncArbitrator.c
+2
-2
tests/tsim/src/simMain.c
tests/tsim/src/simMain.c
+1
-1
未找到文件。
src/dnode/src/dnodeSystem.c
浏览文件 @
33228ee5
...
...
@@ -20,9 +20,9 @@
#include "dnodeMain.h"
static
tsem_t
exitSem
;
static
void
siguser1Handler
(
int32_t
signum
);
static
void
siguser2Handler
(
int32_t
signum
);
static
void
sigintHandler
(
int32_t
signum
);
static
void
siguser1Handler
(
int32_t
signum
,
void
*
sigInfo
,
void
*
context
);
static
void
siguser2Handler
(
int32_t
signum
,
void
*
sigInfo
,
void
*
context
);
static
void
sigintHandler
(
int32_t
signum
,
void
*
sigInfo
,
void
*
context
);
int32_t
main
(
int32_t
argc
,
char
*
argv
[])
{
int
dump_config
=
0
;
...
...
@@ -152,11 +152,11 @@ int32_t main(int32_t argc, char *argv[]) {
return
EXIT_SUCCESS
;
}
static
void
siguser1Handler
(
int32_t
signum
)
{
taosCfgDynamicOptions
(
"debugFlag 143"
);
}
static
void
siguser1Handler
(
int32_t
signum
,
void
*
sigInfo
,
void
*
context
)
{
taosCfgDynamicOptions
(
"debugFlag 143"
);
}
static
void
siguser2Handler
(
int32_t
signum
)
{
taosCfgDynamicOptions
(
"resetlog"
);
}
static
void
siguser2Handler
(
int32_t
signum
,
void
*
sigInfo
,
void
*
context
)
{
taosCfgDynamicOptions
(
"resetlog"
);
}
static
void
sigintHandler
(
int32_t
signum
)
{
static
void
sigintHandler
(
int32_t
signum
,
void
*
sigInfo
,
void
*
context
)
{
// protect the application from receive another signal
taosIgnSignal
(
SIGUSR1
);
taosIgnSignal
(
SIGUSR2
);
...
...
@@ -169,6 +169,10 @@ static void sigintHandler(int32_t signum) {
// clean the system.
dInfo
(
"shut down signal is %d"
,
signum
);
#ifndef WINDOWS
dInfo
(
"sender PID:%d cmdline:%s"
,((
siginfo_t
*
)
sigInfo
)
->
si_pid
,
taosGetCmdlineByPID
(
sigInfo
->
si_pid
));
#endif
syslog
(
LOG_INFO
,
"Shut down signal is %d"
,
signum
);
syslog
(
LOG_INFO
,
"Shutting down TDengine service..."
);
...
...
src/kit/shell/src/shellMain.c
浏览文件 @
33228ee5
...
...
@@ -21,7 +21,7 @@
pthread_t
pid
;
static
tsem_t
cancelSem
;
void
shellQueryInterruptHandler
(
int32_t
signum
)
{
void
shellQueryInterruptHandler
(
int32_t
signum
,
void
*
sigInfo
,
void
*
context
)
{
tsem_post
(
&
cancelSem
);
}
...
...
src/os/inc/osSignal.h
浏览文件 @
33228ee5
...
...
@@ -48,7 +48,7 @@ extern "C" {
#define SIGBREAK 1234
#endif
typedef
void
(
*
FSignalHandler
)(
int32_t
signum
);
typedef
void
(
*
FSignalHandler
)(
int32_t
signum
,
void
*
sigInfo
,
void
*
context
);
void
taosSetSignal
(
int32_t
signum
,
FSignalHandler
sigfp
);
void
taosIgnSignal
(
int32_t
signum
);
void
taosDflSignal
(
int32_t
signum
);
...
...
src/os/src/detail/osSignal.c
浏览文件 @
33228ee5
...
...
@@ -20,10 +20,16 @@
#include "tulog.h"
#ifndef TAOS_OS_FUNC_SIGNAL
typedef
void
(
*
FLinuxSignalHandler
)(
int32_t
signum
,
siginfo_t
*
sigInfo
,
void
*
context
);
void
taosSetSignal
(
int32_t
signum
,
FSignalHandler
sigfp
)
{
struct
sigaction
act
=
{{
0
}};
#if 1
act
.
sa_flags
=
SA_SIGINFO
;
act
.
sa_sigaction
=
(
FLinuxSignalHandler
)
sigfp
;
#else
act
.
sa_handler
=
sigfp
;
#endif
sigaction
(
signum
,
&
act
,
NULL
);
}
...
...
src/os/src/windows/wSignal.c
浏览文件 @
33228ee5
...
...
@@ -18,6 +18,8 @@
#include <signal.h>
#include <windows.h>
typedef
void
(
*
FWinSignalHandler
)(
int32_t
signum
);
void
taosSetSignal
(
int32_t
signum
,
FSignalHandler
sigfp
)
{
if
(
signum
==
SIGUSR1
)
return
;
...
...
@@ -25,7 +27,7 @@ void taosSetSignal(int32_t signum, FSignalHandler sigfp) {
if
(
signum
==
SIGHUP
)
{
SetConsoleCtrlHandler
((
PHANDLER_ROUTINE
)
sigfp
,
TRUE
);
}
else
{
signal
(
signum
,
sigfp
);
signal
(
signum
,
(
FWinSignalHandler
)
sigfp
);
}
}
...
...
src/sync/src/syncArbitrator.c
浏览文件 @
33228ee5
...
...
@@ -27,7 +27,7 @@
#include "syncInt.h"
#include "syncTcp.h"
static
void
arbSignalHandler
(
int32_t
signum
);
static
void
arbSignalHandler
(
int32_t
signum
,
void
*
sigInfo
,
void
*
context
);
static
void
arbProcessIncommingConnection
(
int32_t
connFd
,
uint32_t
sourceIp
);
static
void
arbProcessBrokenLink
(
int64_t
rid
);
static
int32_t
arbProcessPeerMsg
(
int64_t
rid
,
void
*
buffer
);
...
...
@@ -170,7 +170,7 @@ static int32_t arbProcessPeerMsg(int64_t rid, void *buffer) {
return
0
;
}
static
void
arbSignalHandler
(
int32_t
signum
)
{
static
void
arbSignalHandler
(
int32_t
signum
,
void
*
sigInfo
,
void
*
context
)
{
taosIgnSignal
(
SIGTERM
);
taosIgnSignal
(
SIGINT
);
taosIgnSignal
(
SIGABRT
);
...
...
tests/tsim/src/simMain.c
浏览文件 @
33228ee5
...
...
@@ -22,7 +22,7 @@
bool
simAsyncQuery
=
false
;
bool
simExecSuccess
=
false
;
void
simHandleSignal
(
int32_t
signo
)
{
void
simHandleSignal
(
int32_t
signo
,
void
*
sigInfo
,
void
*
context
)
{
simSystemCleanUp
();
exit
(
1
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录