Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4b9fa8e1
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
4b9fa8e1
编写于
2月 28, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
2月 28, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #10431 from taosdata/feature/ZhiqiangWang/config
invalid read
上级
3bbb71a5
30dd3305
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
57 deletion
+30
-57
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+1
-1
source/util/src/tconfig.c
source/util/src/tconfig.c
+13
-20
source/util/src/tlog.c
source/util/src/tlog.c
+16
-36
未找到文件。
source/libs/transport/src/transCli.c
浏览文件 @
4b9fa8e1
...
@@ -127,7 +127,7 @@ static void clientHandleResp(SCliConn* conn) {
...
@@ -127,7 +127,7 @@ static void clientHandleResp(SCliConn* conn) {
// buf's mem alread translated to rpcMsg.pCont
// buf's mem alread translated to rpcMsg.pCont
transClearBuffer
(
&
conn
->
readBuf
);
transClearBuffer
(
&
conn
->
readBuf
);
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
=
{
0
}
;
rpcMsg
.
contLen
=
transContLenFromMsg
(
pHead
->
msgLen
);
rpcMsg
.
contLen
=
transContLenFromMsg
(
pHead
->
msgLen
);
rpcMsg
.
pCont
=
transContFromHead
((
char
*
)
pHead
);
rpcMsg
.
pCont
=
transContFromHead
((
char
*
)
pHead
);
rpcMsg
.
code
=
pHead
->
code
;
rpcMsg
.
code
=
pHead
->
code
;
...
...
source/util/src/tconfig.c
浏览文件 @
4b9fa8e1
...
@@ -96,6 +96,7 @@ void cfgCleanup(SConfig *pCfg) {
...
@@ -96,6 +96,7 @@ void cfgCleanup(SConfig *pCfg) {
SConfigItem
*
pItem
=
taosHashIterate
(
pCfg
->
hash
,
NULL
);
SConfigItem
*
pItem
=
taosHashIterate
(
pCfg
->
hash
,
NULL
);
while
(
pItem
!=
NULL
)
{
while
(
pItem
!=
NULL
)
{
cfgFreeItem
(
pItem
);
cfgFreeItem
(
pItem
);
tfree
(
pItem
->
name
);
pItem
=
taosHashIterate
(
pCfg
->
hash
,
pItem
);
pItem
=
taosHashIterate
(
pCfg
->
hash
,
pItem
);
}
}
taosHashCleanup
(
pCfg
->
hash
);
taosHashCleanup
(
pCfg
->
hash
);
...
@@ -249,9 +250,7 @@ static int32_t cfgSetString(SConfigItem *pItem, const char *value, ECfgSrcType s
...
@@ -249,9 +250,7 @@ static int32_t cfgSetString(SConfigItem *pItem, const char *value, ECfgSrcType s
}
}
static
int32_t
cfgSetDir
(
SConfigItem
*
pItem
,
const
char
*
value
,
ECfgSrcType
stype
)
{
static
int32_t
cfgSetDir
(
SConfigItem
*
pItem
,
const
char
*
value
,
ECfgSrcType
stype
)
{
char
*
tmp
=
strdup
(
value
);
if
(
cfgCheckAndSetDir
(
pItem
,
value
)
!=
0
)
{
if
(
tmp
==
NULL
||
cfgCheckAndSetDir
(
pItem
,
value
)
!=
0
)
{
free
(
tmp
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
uError
(
"cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s"
,
pItem
->
name
,
uError
(
"cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s"
,
pItem
->
name
,
cfgDtypeStr
(
pItem
->
dtype
),
cfgStypeStr
(
stype
),
value
,
terrstr
(),
cfgStypeStr
(
pItem
->
stype
),
pItem
->
str
);
cfgDtypeStr
(
pItem
->
dtype
),
cfgStypeStr
(
stype
),
value
,
terrstr
(),
cfgStypeStr
(
pItem
->
stype
),
pItem
->
str
);
...
@@ -263,9 +262,7 @@ static int32_t cfgSetDir(SConfigItem *pItem, const char *value, ECfgSrcType styp
...
@@ -263,9 +262,7 @@ static int32_t cfgSetDir(SConfigItem *pItem, const char *value, ECfgSrcType styp
}
}
static
int32_t
cfgSetLocale
(
SConfigItem
*
pItem
,
const
char
*
value
,
ECfgSrcType
stype
)
{
static
int32_t
cfgSetLocale
(
SConfigItem
*
pItem
,
const
char
*
value
,
ECfgSrcType
stype
)
{
char
*
tmp
=
strdup
(
value
);
if
(
cfgCheckAndSetLocale
(
pItem
,
value
)
!=
0
)
{
if
(
tmp
==
NULL
||
cfgCheckAndSetLocale
(
pItem
,
value
)
!=
0
)
{
free
(
tmp
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
uError
(
"cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s"
,
pItem
->
name
,
uError
(
"cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s"
,
pItem
->
name
,
cfgDtypeStr
(
pItem
->
dtype
),
cfgStypeStr
(
stype
),
value
,
terrstr
(),
cfgStypeStr
(
pItem
->
stype
),
pItem
->
str
);
cfgDtypeStr
(
pItem
->
dtype
),
cfgStypeStr
(
stype
),
value
,
terrstr
(),
cfgStypeStr
(
pItem
->
stype
),
pItem
->
str
);
...
@@ -277,9 +274,7 @@ static int32_t cfgSetLocale(SConfigItem *pItem, const char *value, ECfgSrcType s
...
@@ -277,9 +274,7 @@ static int32_t cfgSetLocale(SConfigItem *pItem, const char *value, ECfgSrcType s
}
}
static
int32_t
cfgSetCharset
(
SConfigItem
*
pItem
,
const
char
*
value
,
ECfgSrcType
stype
)
{
static
int32_t
cfgSetCharset
(
SConfigItem
*
pItem
,
const
char
*
value
,
ECfgSrcType
stype
)
{
char
*
tmp
=
strdup
(
value
);
if
(
cfgCheckAndSetCharset
(
pItem
,
value
)
!=
0
)
{
if
(
tmp
==
NULL
||
cfgCheckAndSetCharset
(
pItem
,
value
)
!=
0
)
{
free
(
tmp
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
uError
(
"cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s"
,
pItem
->
name
,
uError
(
"cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s"
,
pItem
->
name
,
cfgDtypeStr
(
pItem
->
dtype
),
cfgStypeStr
(
stype
),
value
,
terrstr
(),
cfgStypeStr
(
pItem
->
stype
),
pItem
->
str
);
cfgDtypeStr
(
pItem
->
dtype
),
cfgStypeStr
(
stype
),
value
,
terrstr
(),
cfgStypeStr
(
pItem
->
stype
),
pItem
->
str
);
...
@@ -291,9 +286,7 @@ static int32_t cfgSetCharset(SConfigItem *pItem, const char *value, ECfgSrcType
...
@@ -291,9 +286,7 @@ static int32_t cfgSetCharset(SConfigItem *pItem, const char *value, ECfgSrcType
}
}
static
int32_t
cfgSetTimezone
(
SConfigItem
*
pItem
,
const
char
*
value
,
ECfgSrcType
stype
)
{
static
int32_t
cfgSetTimezone
(
SConfigItem
*
pItem
,
const
char
*
value
,
ECfgSrcType
stype
)
{
char
*
tmp
=
strdup
(
value
);
if
(
cfgCheckAndSetTimezone
(
pItem
,
value
)
!=
0
)
{
if
(
tmp
==
NULL
||
cfgCheckAndSetTimezone
(
pItem
,
value
)
!=
0
)
{
free
(
tmp
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
uError
(
"cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s"
,
pItem
->
name
,
uError
(
"cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s"
,
pItem
->
name
,
cfgDtypeStr
(
pItem
->
dtype
),
cfgStypeStr
(
stype
),
value
,
terrstr
(),
cfgStypeStr
(
pItem
->
stype
),
pItem
->
str
);
cfgDtypeStr
(
pItem
->
dtype
),
cfgStypeStr
(
stype
),
value
,
terrstr
(),
cfgStypeStr
(
pItem
->
stype
),
pItem
->
str
);
...
@@ -366,11 +359,11 @@ int32_t cfgSetItem(SConfig *pCfg, const char *name, const char *value, ECfgSrcTy
...
@@ -366,11 +359,11 @@ int32_t cfgSetItem(SConfig *pCfg, const char *name, const char *value, ECfgSrcTy
}
}
SConfigItem
*
cfgGetItem
(
SConfig
*
pCfg
,
const
char
*
name
)
{
SConfigItem
*
cfgGetItem
(
SConfig
*
pCfg
,
const
char
*
name
)
{
char
lowcaseName
[
CFG_NAME_MAX_LEN
+
1
]
=
{
0
}
;
int32_t
len
=
strlen
(
name
)
;
memcpy
(
lowcaseName
,
name
,
CFG_NAME_MAX_LEN
)
;
char
lowcaseName
[
CFG_NAME_MAX_LEN
+
1
]
=
{
0
}
;
strntolower
(
lowcaseName
,
name
,
CFG_NAME_MAX_LEN
);
strntolower
(
lowcaseName
,
name
,
TMIN
(
CFG_NAME_MAX_LEN
,
len
)
);
SConfigItem
*
pItem
=
taosHashGet
(
pCfg
->
hash
,
lowcaseName
,
strlen
(
lowcaseName
)
+
1
);
SConfigItem
*
pItem
=
taosHashGet
(
pCfg
->
hash
,
lowcaseName
,
len
+
1
);
if
(
pItem
==
NULL
)
{
if
(
pItem
==
NULL
)
{
terrno
=
TSDB_CODE_CFG_NOT_FOUND
;
terrno
=
TSDB_CODE_CFG_NOT_FOUND
;
}
}
...
@@ -386,11 +379,11 @@ static int32_t cfgAddItem(SConfig *pCfg, SConfigItem *pItem, const char *name) {
...
@@ -386,11 +379,11 @@ static int32_t cfgAddItem(SConfig *pCfg, SConfigItem *pItem, const char *name) {
return
-
1
;
return
-
1
;
}
}
char
lowcaseName
[
CFG_NAME_MAX_LEN
+
1
]
=
{
0
}
;
int32_t
len
=
strlen
(
name
)
;
memcpy
(
lowcaseName
,
name
,
CFG_NAME_MAX_LEN
)
;
char
lowcaseName
[
CFG_NAME_MAX_LEN
+
1
]
=
{
0
}
;
strntolower
(
lowcaseName
,
name
,
CFG_NAME_MAX_LEN
);
strntolower
(
lowcaseName
,
name
,
TMIN
(
CFG_NAME_MAX_LEN
,
len
)
);
if
(
taosHashPut
(
pCfg
->
hash
,
lowcaseName
,
strlen
(
lowcaseName
)
+
1
,
pItem
,
sizeof
(
SConfigItem
))
!=
0
)
{
if
(
taosHashPut
(
pCfg
->
hash
,
lowcaseName
,
len
+
1
,
pItem
,
sizeof
(
SConfigItem
))
!=
0
)
{
if
(
pItem
->
dtype
==
CFG_DTYPE_STRING
)
{
if
(
pItem
->
dtype
==
CFG_DTYPE_STRING
)
{
free
(
pItem
->
str
);
free
(
pItem
->
str
);
}
}
...
...
source/util/src/tlog.c
浏览文件 @
4b9fa8e1
...
@@ -64,16 +64,17 @@ typedef struct {
...
@@ -64,16 +64,17 @@ typedef struct {
pthread_mutex_t
logMutex
;
pthread_mutex_t
logMutex
;
}
SLogObj
;
}
SLogObj
;
int8_t
tscEmbeddedInUtil
=
0
;
static
int8_t
tsLogInited
=
0
;
static
SLogObj
tsLogObj
=
{.
fileNum
=
1
};
int8_t
tscEmbeddedInUtil
=
0
;
int32_t
tsLogKeepDays
=
0
;
int32_t
tsLogKeepDays
=
0
;
bool
tsAsyncLog
=
true
;
bool
tsAsyncLog
=
true
;
int
8_t
tsLogInited
=
0
;
int
32_t
tsNumOfLogLines
=
1000000
0
;
int64_t
a
syncLogLostLines
=
0
;
int64_t
tsA
syncLogLostLines
=
0
;
int32_t
w
riteInterval
=
LOG_DEFAULT_INTERVAL
;
int32_t
tsW
riteInterval
=
LOG_DEFAULT_INTERVAL
;
// log
// log
int32_t
tsNumOfLogLines
=
10000000
;
int32_t
dDebugFlag
=
135
;
int32_t
dDebugFlag
=
135
;
int32_t
vDebugFlag
=
135
;
int32_t
vDebugFlag
=
135
;
int32_t
mDebugFlag
=
131
;
int32_t
mDebugFlag
=
131
;
...
@@ -95,13 +96,11 @@ int64_t dbgSmallWN = 0;
...
@@ -95,13 +96,11 @@ int64_t dbgSmallWN = 0;
int64_t
dbgBigWN
=
0
;
int64_t
dbgBigWN
=
0
;
int64_t
dbgWSize
=
0
;
int64_t
dbgWSize
=
0
;
static
SLogObj
tsLogObj
=
{.
fileNum
=
1
};
static
void
*
taosAsyncOutputLog
(
void
*
param
);
static
void
*
taosAsyncOutputLog
(
void
*
param
);
static
int32_t
taosPushLogBuffer
(
SLogBuff
*
tLogBuff
,
char
*
msg
,
int32_t
msgLen
);
static
int32_t
taosPushLogBuffer
(
SLogBuff
*
tLogBuff
,
char
*
msg
,
int32_t
msgLen
);
static
SLogBuff
*
taosLogBuffNew
(
int32_t
bufSize
);
static
SLogBuff
*
taosLogBuffNew
(
int32_t
bufSize
);
static
void
taosCloseLogByFd
(
TdFilePtr
pFile
);
static
void
taosCloseLogByFd
(
TdFilePtr
pFile
);
static
int32_t
taosOpenLogFile
(
char
*
fn
,
int32_t
maxLines
,
int32_t
maxFileNum
);
static
int32_t
taosOpenLogFile
(
char
*
fn
,
int32_t
maxLines
,
int32_t
maxFileNum
);
extern
void
taosPrintCfg
();
static
int32_t
taosCompressFile
(
char
*
srcFileName
,
char
*
destFileName
);
static
int32_t
taosCompressFile
(
char
*
srcFileName
,
char
*
destFileName
);
static
int32_t
taosStartLog
()
{
static
int32_t
taosStartLog
()
{
...
@@ -125,7 +124,6 @@ int32_t taosInitLog(const char *logName, int maxFiles) {
...
@@ -125,7 +124,6 @@ int32_t taosInitLog(const char *logName, int maxFiles) {
if
(
tsLogObj
.
logHandle
==
NULL
)
return
-
1
;
if
(
tsLogObj
.
logHandle
==
NULL
)
return
-
1
;
if
(
taosOpenLogFile
(
fullName
,
tsNumOfLogLines
,
maxFiles
)
<
0
)
return
-
1
;
if
(
taosOpenLogFile
(
fullName
,
tsNumOfLogLines
,
maxFiles
)
<
0
)
return
-
1
;
if
(
taosStartLog
()
<
0
)
return
-
1
;
if
(
taosStartLog
()
<
0
)
return
-
1
;
tsLogInited
=
true
;
return
0
;
return
0
;
}
}
...
@@ -137,8 +135,6 @@ static void taosStopLog() {
...
@@ -137,8 +135,6 @@ static void taosStopLog() {
void
taosCloseLog
()
{
void
taosCloseLog
()
{
taosStopLog
();
taosStopLog
();
// tsem_post(&(tsLogObj.logHandle->buffNotEmpty));
taosMsleep
(
LOG_MAX_INTERVAL
/
1000
);
if
(
taosCheckPthreadValid
(
tsLogObj
.
logHandle
->
asyncThread
))
{
if
(
taosCheckPthreadValid
(
tsLogObj
.
logHandle
->
asyncThread
))
{
pthread_join
(
tsLogObj
.
logHandle
->
asyncThread
,
NULL
);
pthread_join
(
tsLogObj
.
logHandle
->
asyncThread
,
NULL
);
}
}
...
@@ -218,7 +214,6 @@ static void *taosThreadToOpenNewFile(void *param) {
...
@@ -218,7 +214,6 @@ static void *taosThreadToOpenNewFile(void *param) {
uInfo
(
" new log file:%d is opened"
,
tsLogObj
.
flag
);
uInfo
(
" new log file:%d is opened"
,
tsLogObj
.
flag
);
uInfo
(
"=================================="
);
uInfo
(
"=================================="
);
// taosPrintCfg();
taosKeepOldLog
(
keepName
);
taosKeepOldLog
(
keepName
);
return
NULL
;
return
NULL
;
...
@@ -498,12 +493,6 @@ void taosPrintLongString(const char *flags, int32_t dflag, const char *format, .
...
@@ -498,12 +493,6 @@ void taosPrintLongString(const char *flags, int32_t dflag, const char *format, .
if
(
dflag
&
DEBUG_SCREEN
)
write
(
1
,
buffer
,
(
uint32_t
)
len
);
if
(
dflag
&
DEBUG_SCREEN
)
write
(
1
,
buffer
,
(
uint32_t
)
len
);
}
}
#if 0
void taosCloseLog() {
taosCloseLogByFd(tsLogObj.logHandle->pFile);
}
#endif
static
void
taosCloseLogByFd
(
TdFilePtr
pFile
)
{
static
void
taosCloseLogByFd
(
TdFilePtr
pFile
)
{
if
(
pFile
!=
NULL
)
{
if
(
pFile
!=
NULL
)
{
taosUnLockLogFile
(
pFile
);
taosUnLockLogFile
(
pFile
);
...
@@ -536,15 +525,6 @@ _err:
...
@@ -536,15 +525,6 @@ _err:
return
NULL
;
return
NULL
;
}
}
#if 0
static void taosLogBuffDestroy(SLogBuff *tLogBuff) {
tsem_destroy(&(tLogBuff->buffNotEmpty));
pthread_mutex_destroy(&(tLogBuff->buffMutex));
free(tLogBuff->buffer);
tfree(tLogBuff);
}
#endif
static
void
taosCopyLogBuffer
(
SLogBuff
*
tLogBuff
,
int32_t
start
,
int32_t
end
,
char
*
msg
,
int32_t
msgLen
)
{
static
void
taosCopyLogBuffer
(
SLogBuff
*
tLogBuff
,
int32_t
start
,
int32_t
end
,
char
*
msg
,
int32_t
msgLen
)
{
if
(
start
>
end
)
{
if
(
start
>
end
)
{
memcpy
(
LOG_BUF_BUFFER
(
tLogBuff
)
+
end
,
msg
,
msgLen
);
memcpy
(
LOG_BUF_BUFFER
(
tLogBuff
)
+
end
,
msg
,
msgLen
);
...
@@ -582,7 +562,7 @@ static int32_t taosPushLogBuffer(SLogBuff *tLogBuff, char *msg, int32_t msgLen)
...
@@ -582,7 +562,7 @@ static int32_t taosPushLogBuffer(SLogBuff *tLogBuff, char *msg, int32_t msgLen)
if
(
remainSize
<=
msgLen
||
((
lostLine
>
0
)
&&
(
remainSize
<=
(
msgLen
+
tmpBufLen
))))
{
if
(
remainSize
<=
msgLen
||
((
lostLine
>
0
)
&&
(
remainSize
<=
(
msgLen
+
tmpBufLen
))))
{
lostLine
++
;
lostLine
++
;
a
syncLogLostLines
++
;
tsA
syncLogLostLines
++
;
pthread_mutex_unlock
(
&
LOG_BUF_MUTEX
(
tLogBuff
));
pthread_mutex_unlock
(
&
LOG_BUF_MUTEX
(
tLogBuff
));
return
-
1
;
return
-
1
;
}
}
...
@@ -627,13 +607,13 @@ static void taosWriteLog(SLogBuff *tLogBuff) {
...
@@ -627,13 +607,13 @@ static void taosWriteLog(SLogBuff *tLogBuff) {
if
(
start
==
end
)
{
if
(
start
==
end
)
{
dbgEmptyW
++
;
dbgEmptyW
++
;
w
riteInterval
=
LOG_MAX_INTERVAL
;
tsW
riteInterval
=
LOG_MAX_INTERVAL
;
return
;
return
;
}
}
pollSize
=
taosGetLogRemainSize
(
tLogBuff
,
start
,
end
);
pollSize
=
taosGetLogRemainSize
(
tLogBuff
,
start
,
end
);
if
(
pollSize
<
tLogBuff
->
minBuffSize
)
{
if
(
pollSize
<
tLogBuff
->
minBuffSize
)
{
lastDuration
+=
w
riteInterval
;
lastDuration
+=
tsW
riteInterval
;
if
(
lastDuration
<
LOG_MAX_WAIT_MSEC
)
{
if
(
lastDuration
<
LOG_MAX_WAIT_MSEC
)
{
break
;
break
;
}
}
...
@@ -656,15 +636,15 @@ static void taosWriteLog(SLogBuff *tLogBuff) {
...
@@ -656,15 +636,15 @@ static void taosWriteLog(SLogBuff *tLogBuff) {
if
(
pollSize
<
tLogBuff
->
minBuffSize
)
{
if
(
pollSize
<
tLogBuff
->
minBuffSize
)
{
dbgSmallWN
++
;
dbgSmallWN
++
;
if
(
w
riteInterval
<
LOG_MAX_INTERVAL
)
{
if
(
tsW
riteInterval
<
LOG_MAX_INTERVAL
)
{
w
riteInterval
+=
LOG_INTERVAL_STEP
;
tsW
riteInterval
+=
LOG_INTERVAL_STEP
;
}
}
}
else
if
(
pollSize
>
LOG_BUF_SIZE
(
tLogBuff
)
/
3
)
{
}
else
if
(
pollSize
>
LOG_BUF_SIZE
(
tLogBuff
)
/
3
)
{
dbgBigWN
++
;
dbgBigWN
++
;
w
riteInterval
=
LOG_MIN_INTERVAL
;
tsW
riteInterval
=
LOG_MIN_INTERVAL
;
}
else
if
(
pollSize
>
LOG_BUF_SIZE
(
tLogBuff
)
/
4
)
{
}
else
if
(
pollSize
>
LOG_BUF_SIZE
(
tLogBuff
)
/
4
)
{
if
(
w
riteInterval
>
LOG_MIN_INTERVAL
)
{
if
(
tsW
riteInterval
>
LOG_MIN_INTERVAL
)
{
w
riteInterval
-=
LOG_INTERVAL_STEP
;
tsW
riteInterval
-=
LOG_INTERVAL_STEP
;
}
}
}
}
...
@@ -678,7 +658,7 @@ static void taosWriteLog(SLogBuff *tLogBuff) {
...
@@ -678,7 +658,7 @@ static void taosWriteLog(SLogBuff *tLogBuff) {
break
;
break
;
}
}
w
riteInterval
=
LOG_MIN_INTERVAL
;
tsW
riteInterval
=
LOG_MIN_INTERVAL
;
remainChecked
=
1
;
remainChecked
=
1
;
}
while
(
1
);
}
while
(
1
);
...
@@ -689,7 +669,7 @@ static void *taosAsyncOutputLog(void *param) {
...
@@ -689,7 +669,7 @@ static void *taosAsyncOutputLog(void *param) {
setThreadName
(
"log"
);
setThreadName
(
"log"
);
while
(
1
)
{
while
(
1
)
{
taosMsleep
(
w
riteInterval
);
taosMsleep
(
tsW
riteInterval
);
// Polling the buffer
// Polling the buffer
taosWriteLog
(
tLogBuff
);
taosWriteLog
(
tLogBuff
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录