Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ea47b4da
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看板
提交
ea47b4da
编写于
3月 12, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
shm
上级
80a4c22e
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
89 addition
and
53 deletion
+89
-53
include/common/tglobal.h
include/common/tglobal.h
+1
-0
include/dnode/mgmt/dnode.h
include/dnode/mgmt/dnode.h
+18
-2
include/util/tprocess.h
include/util/tprocess.h
+2
-1
source/common/src/tglobal.c
source/common/src/tglobal.c
+3
-0
source/dnode/mgmt/daemon/inc/dmnInt.h
source/dnode/mgmt/daemon/inc/dmnInt.h
+8
-1
source/dnode/mgmt/daemon/src/dmnMain.c
source/dnode/mgmt/daemon/src/dmnMain.c
+20
-24
source/dnode/mgmt/impl/inc/dndEnv.h
source/dnode/mgmt/impl/inc/dndEnv.h
+2
-1
source/dnode/mgmt/impl/inc/dndInt.h
source/dnode/mgmt/impl/inc/dndInt.h
+4
-4
source/dnode/mgmt/impl/mnodeMgmt/src/mmMgmt.c
source/dnode/mgmt/impl/mnodeMgmt/src/mmMgmt.c
+1
-1
source/dnode/mgmt/impl/src/dndEnv.c
source/dnode/mgmt/impl/src/dndEnv.c
+22
-12
source/dnode/mgmt/impl/src/dndMgmt.c
source/dnode/mgmt/impl/src/dndMgmt.c
+1
-1
source/dnode/mgmt/impl/src/dndTransport.c
source/dnode/mgmt/impl/src/dndTransport.c
+3
-3
source/util/src/tlog.c
source/util/src/tlog.c
+1
-0
source/util/src/tprocess.c
source/util/src/tprocess.c
+3
-3
未找到文件。
include/common/tglobal.h
浏览文件 @
ea47b4da
...
...
@@ -51,6 +51,7 @@ extern int32_t tsCompatibleModel;
extern
bool
tsEnableSlaveQuery
;
extern
bool
tsPrintAuth
;
extern
int64_t
tsTickPerDay
[
3
];
extern
bool
tsMultiProcess
;
// monitor
extern
bool
tsEnableMonitor
;
...
...
include/dnode/mgmt/dnode.h
浏览文件 @
ea47b4da
...
...
@@ -33,8 +33,7 @@ typedef struct SDnode SDnode;
int32_t
dndInit
();
/**
* @brief clear the environment
*
* @brief Clear the environment
*/
void
dndCleanup
();
...
...
@@ -51,6 +50,8 @@ typedef struct {
int32_t
numOfDisks
;
}
SDnodeObjCfg
;
typedef
enum
{
DND_EVENT_STOP
=
1
,
DND_EVENT_RELOAD
}
EDndEvent
;
/**
* @brief Initialize and start the dnode.
*
...
...
@@ -66,6 +67,21 @@ SDnode *dndCreate(SDnodeObjCfg *pCfg);
*/
void
dndClose
(
SDnode
*
pDnode
);
/**
* @brief Run dnode until specific event is receive.
*
* @param pDnode The dnode object to run.
*/
void
dndRun
(
SDnode
*
pDnode
);
/**
* @brief Handle event in the dnode.
*
* @param pDnode The dnode object to close.
* @param event The event to handle.
*/
void
dndeHandleEvent
(
SDnode
*
pDnode
,
EDndEvent
event
);
#ifdef __cplusplus
}
#endif
...
...
include/util/tprocess.h
浏览文件 @
ea47b4da
...
...
@@ -48,8 +48,9 @@ typedef struct {
SProcObj
*
taosProcInit
(
const
SProcCfg
*
pCfg
);
void
taosProcCleanup
(
SProcObj
*
pProc
);
int32_t
taosProc
Start
(
SProcObj
*
pProc
);
int32_t
taosProc
Run
(
SProcObj
*
pProc
);
void
taosProcStop
(
SProcObj
*
pProc
);
bool
taosProcIsChild
(
SProcObj
*
pProc
);
int32_t
taosProcPutToChildQueue
(
SProcObj
*
pProc
,
void
*
pHead
,
int32_t
headLen
,
void
*
pBody
,
int32_t
bodyLen
);
int32_t
taosProcPutToParentQueue
(
SProcObj
*
pProc
,
void
*
pHead
,
int32_t
headLen
,
void
*
pBody
,
int32_t
bodyLen
);
...
...
source/common/src/tglobal.c
浏览文件 @
ea47b4da
...
...
@@ -45,6 +45,7 @@ float tsRatioOfQueryCores = 1.0f;
int32_t
tsMaxBinaryDisplayWidth
=
30
;
bool
tsEnableSlaveQuery
=
1
;
bool
tsPrintAuth
=
0
;
bool
tsMultiProcess
=
0
;
// monitor
bool
tsEnableMonitor
=
1
;
...
...
@@ -339,6 +340,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
if
(
cfgAddBool
(
pCfg
,
"printAuth"
,
tsPrintAuth
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"slaveQuery"
,
tsEnableSlaveQuery
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"deadLockKillQuery"
,
tsDeadLockKillQuery
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"multiProcess"
,
tsMultiProcess
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"monitor"
,
tsEnableMonitor
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"monitorInterval"
,
tsMonitorInterval
,
1
,
360000
,
0
)
!=
0
)
return
-
1
;
...
...
@@ -456,6 +458,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
tsPrintAuth
=
cfgGetItem
(
pCfg
,
"printAuth"
)
->
bval
;
tsEnableSlaveQuery
=
cfgGetItem
(
pCfg
,
"slaveQuery"
)
->
bval
;
tsDeadLockKillQuery
=
cfgGetItem
(
pCfg
,
"deadLockKillQuery"
)
->
bval
;
tsMultiProcess
=
cfgGetItem
(
pCfg
,
"multiProcess"
)
->
bval
;
tsEnableMonitor
=
cfgGetItem
(
pCfg
,
"monitor"
)
->
bval
;
tsMonitorInterval
=
cfgGetItem
(
pCfg
,
"monitorInterval"
)
->
i32
;
...
...
source/dnode/mgmt/daemon/inc/dmnInt.h
浏览文件 @
ea47b4da
...
...
@@ -28,12 +28,19 @@
extern
"C"
{
#endif
SDnodeObjCfg
dmnGetObjCfg
();
#define dFatal(...) { if (dDebugFlag & DEBUG_FATAL) { taosPrintLog("DND FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }}
#define dError(...) { if (dDebugFlag & DEBUG_ERROR) { taosPrintLog("DND ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }}
#define dWarn(...) { if (dDebugFlag & DEBUG_WARN) { taosPrintLog("DND WARN ", DEBUG_WARN, 255, __VA_ARGS__); }}
#define dInfo(...) { if (dDebugFlag & DEBUG_INFO) { taosPrintLog("DND ", DEBUG_INFO, 255, __VA_ARGS__); }}
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }}
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }}
void
dmnDumpCfg
();
void
dmnPrintVersion
();
void
dmnGenerateGrant
();
SDnodeObjCfg
dmnGetObjCfg
();
#ifdef __cplusplus
}
#endif
...
...
source/dnode/mgmt/daemon/src/dmnMain.c
浏览文件 @
ea47b4da
...
...
@@ -17,18 +17,18 @@
#include "dmnInt.h"
static
struct
{
bool
stop
;
bool
dumpConfig
;
bool
generateGrant
;
bool
printAuth
;
bool
printVersion
;
char
envFile
[
PATH_MAX
];
char
apolloUrl
[
PATH_MAX
]
;
bool
dumpConfig
;
bool
generateGrant
;
bool
printAuth
;
bool
printVersion
;
char
envFile
[
PATH_MAX
]
;
char
apolloUrl
[
PATH_MAX
];
SDnode
*
pDnode
;
}
dmn
=
{
0
};
static
void
dmnSigintHandle
(
int
signum
,
void
*
info
,
void
*
ctx
)
{
u
Info
(
"singal:%d is received"
,
signum
);
d
mn
.
stop
=
true
;
d
Info
(
"singal:%d is received"
,
signum
);
d
ndeHandleEvent
(
dmn
.
pDnode
,
DND_EVENT_STOP
)
;
}
static
void
dmnSetSignalHandle
()
{
...
...
@@ -39,13 +39,6 @@ static void dmnSetSignalHandle() {
taosSetSignal
(
SIGBREAK
,
dmnSigintHandle
);
}
static
void
dmnWaitSignal
()
{
dmnSetSignalHandle
();
while
(
!
dmn
.
stop
)
{
taosMsleep
(
100
);
}
}
static
int32_t
dmnParseOption
(
int32_t
argc
,
char
const
*
argv
[])
{
for
(
int32_t
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
strcmp
(
argv
[
i
],
"-c"
)
==
0
)
{
...
...
@@ -74,20 +67,22 @@ static int32_t dmnParseOption(int32_t argc, char const *argv[]) {
int32_t
dmnRunDnode
()
{
if
(
dndInit
()
!=
0
)
{
uInfo
(
"Failed to start TDengine, please check the log"
);
dInfo
(
"failed to initialize dnode environment since %s"
,
terrstr
()
);
return
-
1
;
}
SDnodeObjCfg
objCfg
=
dmnGetObjCfg
();
SDnode
*
pDnode
=
dndCreate
(
&
objCfg
);
if
(
pDnode
==
NULL
)
{
uInfo
(
"Failed to start TDengine, please check the log"
);
dError
(
"failed to to create dnode object since %s"
,
terrstr
()
);
return
-
1
;
}
else
{
dmn
.
pDnode
=
pDnode
;
}
uInfo
(
"Started TDengine service successfully.
"
);
d
mnWaitSignal
(
);
uInfo
(
"TDengine is shut down!
"
);
dInfo
(
"start the TDengine service
"
);
d
ndRun
(
pDnode
);
dInfo
(
"start shutting down the TDengine service
"
);
dndClose
(
pDnode
);
dndCleanup
();
...
...
@@ -98,7 +93,7 @@ int32_t dmnRunDnode() {
int
main
(
int
argc
,
char
const
*
argv
[])
{
if
(
!
taosCheckSystemIsSmallEnd
())
{
uError
(
"TDengine does not run on non-small-end machines.
"
);
dError
(
"failed to start TDengine since on non-small-end machines
"
);
return
-
1
;
}
...
...
@@ -117,18 +112,19 @@ int main(int argc, char const *argv[]) {
}
if
(
taosCreateLog
(
"taosdlog"
,
1
,
configDir
,
dmn
.
envFile
,
dmn
.
apolloUrl
,
NULL
,
0
)
!=
0
)
{
uInfo
(
"Failed to start TDengine since read
config error"
);
dError
(
"failed to start TDengine since read log
config error"
);
return
-
1
;
}
if
(
taosInitCfg
(
configDir
,
dmn
.
envFile
,
dmn
.
apolloUrl
,
NULL
,
0
)
!=
0
)
{
uInfo
(
"F
ailed to start TDengine since read config error"
);
dError
(
"f
ailed to start TDengine since read config error"
);
return
-
1
;
}
if
(
dmn
.
dumpConfig
)
{
dmnDumpCfg
();
taosCleanupCfg
();
taosCloseLog
();
return
0
;
}
...
...
source/dnode/mgmt/impl/inc/dndEnv.h
浏览文件 @
ea47b4da
...
...
@@ -139,7 +139,7 @@ typedef struct {
}
STransMgmt
;
typedef
struct
SDnode
{
E
Stat
stat
;
E
DndStatus
status
;
SDnodeObjCfg
cfg
;
SDnodeDir
dir
;
TdFilePtr
pLockFile
;
...
...
@@ -152,6 +152,7 @@ typedef struct SDnode {
STransMgmt
tmgmt
;
STfs
*
pTfs
;
SStartupReq
startup
;
EDndEvent
event
;
}
SDnode
;
int32_t
dndGetMonitorDiskInfo
(
SDnode
*
pDnode
,
SMonDiskInfo
*
pInfo
);
...
...
source/dnode/mgmt/impl/inc/dndInt.h
浏览文件 @
ea47b4da
...
...
@@ -56,16 +56,16 @@ extern "C" {
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }}
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }}
typedef
enum
{
DND_STAT_INIT
,
DND_STAT_RUNNING
,
DND_STAT_STOPPED
}
E
Stat
;
typedef
enum
{
DND_STAT_INIT
,
DND_STAT_RUNNING
,
DND_STAT_STOPPED
}
E
DndStatus
;
typedef
enum
{
DND_WORKER_SINGLE
,
DND_WORKER_MULTI
}
EWorkerType
;
typedef
enum
{
DND_ENV_INIT
=
0
,
DND_ENV_READY
=
1
,
DND_ENV_CLEANUP
=
2
}
EEnvStat
;
typedef
void
(
*
DndMsgFp
)(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEps
);
typedef
int32_t
(
*
MndMsgFp
)(
SDnode
*
pDnode
,
SMndMsg
*
pMnodeMsg
);
E
Stat
dndGetStat
(
SDnode
*
pDnode
);
void
dndSetStat
(
SDnode
*
pDnode
,
EStat
stat
);
const
char
*
dndStatStr
(
E
Stat
stat
);
E
DndStatus
dndGetStatus
(
SDnode
*
pDnode
);
void
dndSetStat
us
(
SDnode
*
pDnode
,
EDndStatus
stat
);
const
char
*
dndStatStr
(
E
DndStatus
stat
);
void
dndReportStartup
(
SDnode
*
pDnode
,
char
*
pName
,
char
*
pDesc
);
void
dndGetStartup
(
SDnode
*
pDnode
,
SStartupReq
*
pStartup
);
...
...
source/dnode/mgmt/impl/mnodeMgmt/src/mmMgmt.c
浏览文件 @
ea47b4da
...
...
@@ -143,7 +143,7 @@ int32_t mmOpen(SDnode *pDnode, SMnodeOpt *pOption) {
return
-
1
;
}
return
taosProc
Start
(
pMgmt
->
pProcess
);
return
taosProc
Run
(
pMgmt
->
pProcess
);
}
return
code
;
...
...
source/dnode/mgmt/impl/src/dndEnv.c
浏览文件 @
ea47b4da
...
...
@@ -28,15 +28,17 @@
static
int8_t
once
=
DND_ENV_INIT
;
E
Stat
dndGetStat
(
SDnode
*
pDnode
)
{
return
pDnode
->
stat
;
}
E
DndStatus
dndGetStatus
(
SDnode
*
pDnode
)
{
return
pDnode
->
status
;
}
void
dndSetStat
(
SDnode
*
pDnode
,
EStat
stat
)
{
dDebug
(
"dnode status set from %s to %s"
,
dndStatStr
(
pDnode
->
stat
),
dndStatStr
(
stat
));
pDnode
->
stat
=
stat
;
void
dndSetStatus
(
SDnode
*
pDnode
,
EDndStatus
status
)
{
if
(
pDnode
->
status
!=
status
)
{
dDebug
(
"dnode status set from %s to %s"
,
dndStatStr
(
pDnode
->
status
),
dndStatStr
(
status
));
pDnode
->
status
=
status
;
}
}
const
char
*
dndStatStr
(
E
Stat
stat
)
{
switch
(
stat
)
{
const
char
*
dndStatStr
(
E
DndStatus
status
)
{
switch
(
stat
us
)
{
case
DND_STAT_INIT
:
return
"init"
;
case
DND_STAT_RUNNING
:
...
...
@@ -57,7 +59,7 @@ void dndReportStartup(SDnode *pDnode, char *pName, char *pDesc) {
void
dndGetStartup
(
SDnode
*
pDnode
,
SStartupReq
*
pStartup
)
{
memcpy
(
pStartup
,
&
pDnode
->
startup
,
sizeof
(
SStartupReq
));
pStartup
->
finished
=
(
dndGetStat
(
pDnode
)
==
DND_STAT_RUNNING
);
pStartup
->
finished
=
(
dndGetStat
us
(
pDnode
)
==
DND_STAT_RUNNING
);
}
static
TdFilePtr
dndCheckRunning
(
char
*
dataDir
)
{
...
...
@@ -165,7 +167,7 @@ SDnode *dndCreate(SDnodeObjCfg *pCfg) {
return
NULL
;
}
dndSetStat
(
pDnode
,
DND_STAT_INIT
);
dndSetStat
us
(
pDnode
,
DND_STAT_INIT
);
if
(
dndInitDir
(
pDnode
,
pCfg
)
!=
0
)
{
dError
(
"failed to init dnode dir since %s"
,
terrstr
());
...
...
@@ -233,7 +235,7 @@ SDnode *dndCreate(SDnodeObjCfg *pCfg) {
return
NULL
;
}
dndSetStat
(
pDnode
,
DND_STAT_RUNNING
);
dndSetStat
us
(
pDnode
,
DND_STAT_RUNNING
);
dndSendStatusReq
(
pDnode
);
dndReportStartup
(
pDnode
,
"TDengine"
,
"initialized successfully"
);
dInfo
(
"dnode object is created, data:%p"
,
pDnode
);
...
...
@@ -244,13 +246,13 @@ SDnode *dndCreate(SDnodeObjCfg *pCfg) {
void
dndClose
(
SDnode
*
pDnode
)
{
if
(
pDnode
==
NULL
)
return
;
if
(
dndGetStat
(
pDnode
)
==
DND_STAT_STOPPED
)
{
if
(
dndGetStat
us
(
pDnode
)
==
DND_STAT_STOPPED
)
{
dError
(
"dnode is shutting down, data:%p"
,
pDnode
);
return
;
}
dInfo
(
"start to close dnode, data:%p"
,
pDnode
);
dndSetStat
(
pDnode
,
DND_STAT_STOPPED
);
dndSetStat
us
(
pDnode
,
DND_STAT_STOPPED
);
dndCleanupTrans
(
pDnode
);
dndStopMgmt
(
pDnode
);
mmCleanup
(
pDnode
);
...
...
@@ -331,4 +333,12 @@ int32_t dndGetMonitorDiskInfo(SDnode *pDnode, SMonDiskInfo *pInfo) {
pInfo
->
tempdir
.
size
=
tsTempSpace
.
size
;
return
tfsGetMonitorInfo
(
pDnode
->
pTfs
,
pInfo
);
}
\ No newline at end of file
}
void
dndRun
(
SDnode
*
pDnode
)
{
while
(
pDnode
->
event
!=
DND_EVENT_STOP
)
{
taosMsleep
(
100
);
}
}
void
dndeHandleEvent
(
SDnode
*
pDnode
,
EDndEvent
event
)
{
pDnode
->
event
=
event
;
}
\ No newline at end of file
source/dnode/mgmt/impl/src/dndMgmt.c
浏览文件 @
ea47b4da
...
...
@@ -555,7 +555,7 @@ static void *dnodeThreadRoutine(void *param) {
while
(
true
)
{
pthread_testcancel
();
taosMsleep
(
200
);
if
(
dndGetStat
(
pDnode
)
!=
DND_STAT_RUNNING
||
pMgmt
->
dropped
)
{
if
(
dndGetStat
us
(
pDnode
)
!=
DND_STAT_RUNNING
||
pMgmt
->
dropped
)
{
continue
;
}
...
...
source/dnode/mgmt/impl/src/dndTransport.c
浏览文件 @
ea47b4da
...
...
@@ -161,7 +161,7 @@ static void dndProcessResponse(void *parent, SRpcMsg *pRsp, SEpSet *pEpSet) {
tmsg_t
msgType
=
pRsp
->
msgType
;
if
(
dndGetStat
(
pDnode
)
==
DND_STAT_STOPPED
)
{
if
(
dndGetStat
us
(
pDnode
)
==
DND_STAT_STOPPED
)
{
if
(
pRsp
==
NULL
||
pRsp
->
pCont
==
NULL
)
return
;
dTrace
(
"RPC %p, rsp:%s ignored since dnode exiting, app:%p"
,
pRsp
->
handle
,
TMSG_INFO
(
msgType
),
pRsp
->
ahandle
);
rpcFreeCont
(
pRsp
->
pCont
);
...
...
@@ -229,13 +229,13 @@ static void dndProcessRequest(void *param, SRpcMsg *pReq, SEpSet *pEpSet) {
return
;
}
if
(
dndGetStat
(
pDnode
)
==
DND_STAT_STOPPED
)
{
if
(
dndGetStat
us
(
pDnode
)
==
DND_STAT_STOPPED
)
{
dError
(
"RPC %p, req:%s ignored since dnode exiting, app:%p"
,
pReq
->
handle
,
TMSG_INFO
(
msgType
),
pReq
->
ahandle
);
SRpcMsg
rspMsg
=
{.
handle
=
pReq
->
handle
,
.
code
=
TSDB_CODE_DND_OFFLINE
,
.
ahandle
=
pReq
->
ahandle
};
rpcSendResponse
(
&
rspMsg
);
rpcFreeCont
(
pReq
->
pCont
);
return
;
}
else
if
(
dndGetStat
(
pDnode
)
!=
DND_STAT_RUNNING
)
{
}
else
if
(
dndGetStat
us
(
pDnode
)
!=
DND_STAT_RUNNING
)
{
dError
(
"RPC %p, req:%s ignored since dnode not running, app:%p"
,
pReq
->
handle
,
TMSG_INFO
(
msgType
),
pReq
->
ahandle
);
SRpcMsg
rspMsg
=
{.
handle
=
pReq
->
handle
,
.
code
=
TSDB_CODE_APP_NOT_READY
,
.
ahandle
=
pReq
->
ahandle
};
rpcSendResponse
(
&
rspMsg
);
...
...
source/util/src/tlog.c
浏览文件 @
ea47b4da
...
...
@@ -141,6 +141,7 @@ void taosCloseLog() {
if
(
taosCheckPthreadValid
(
tsLogObj
.
logHandle
->
asyncThread
))
{
pthread_join
(
tsLogObj
.
logHandle
->
asyncThread
,
NULL
);
}
tsLogInited
=
0
;
// In case that other threads still use log resources causing invalid write in valgrind
// we comment two lines below.
// taosLogBuffDestroy(tsLogObj.logHandle);
...
...
source/util/src/tprocess.c
浏览文件 @
ea47b4da
...
...
@@ -374,8 +374,6 @@ SProcObj *taosProcInit(const SProcCfg *pCfg) {
if
(
!
pProc
->
testFlag
)
{
pProc
->
pid
=
fork
();
if
(
pProc
->
pid
==
0
)
{
// tsLogInited = 0;
taosInitLog
(
"mnodelog"
,
1
);
pProc
->
isChild
=
1
;
uInfo
(
"this is child process, pid:%d"
,
pProc
->
pid
);
}
else
{
...
...
@@ -410,7 +408,7 @@ static void taosProcThreadLoop(SProcQueue *pQueue) {
}
}
int32_t
taosProc
Start
(
SProcObj
*
pProc
)
{
int32_t
taosProc
Run
(
SProcObj
*
pProc
)
{
pthread_attr_t
thAttr
=
{
0
};
pthread_attr_init
(
&
thAttr
);
pthread_attr_setdetachstate
(
&
thAttr
,
PTHREAD_CREATE_JOINABLE
);
...
...
@@ -442,6 +440,8 @@ void taosProcStop(SProcObj *pProc) {
// join
}
bool
taosProcIsChild
(
SProcObj
*
pProc
)
{
return
pProc
->
isChild
;
}
void
taosProcCleanup
(
SProcObj
*
pProc
)
{
if
(
pProc
!=
NULL
)
{
uDebug
(
"proc:%s, clean up"
,
pProc
->
name
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录