Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
52b28fbc
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
52b28fbc
编写于
11月 11, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix ahandle mem leak
上级
8fa39acc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
31 addition
and
6 deletion
+31
-6
source/client/src/clientHb.c
source/client/src/clientHb.c
+4
-1
source/libs/transport/inc/transComm.h
source/libs/transport/inc/transComm.h
+1
-1
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+25
-3
source/libs/transport/src/transComm.c
source/libs/transport/src/transComm.c
+1
-1
未找到文件。
source/client/src/clientHb.c
浏览文件 @
52b28fbc
...
...
@@ -61,7 +61,8 @@ static int32_t hbProcessDBInfoRsp(void *value, int32_t valueLen, struct SCatalog
int32_t
numOfBatchs
=
taosArrayGetSize
(
batchUseRsp
.
pArray
);
for
(
int32_t
i
=
0
;
i
<
numOfBatchs
;
++
i
)
{
SUseDbRsp
*
rsp
=
taosArrayGet
(
batchUseRsp
.
pArray
,
i
);
tscDebug
(
"hb db rsp, db:%s, vgVersion:%d, stateTs:%"
PRId64
", uid:%"
PRIx64
,
rsp
->
db
,
rsp
->
vgVersion
,
rsp
->
stateTs
,
rsp
->
uid
);
tscDebug
(
"hb db rsp, db:%s, vgVersion:%d, stateTs:%"
PRId64
", uid:%"
PRIx64
,
rsp
->
db
,
rsp
->
vgVersion
,
rsp
->
stateTs
,
rsp
->
uid
);
if
(
rsp
->
vgVersion
<
0
)
{
code
=
catalogRemoveDB
(
pCatalog
,
rsp
->
db
,
rsp
->
uid
);
...
...
@@ -293,6 +294,7 @@ static int32_t hbAsyncCallBack(void *param, SDataBuf *pMsg, int32_t code) {
taosThreadMutexUnlock
(
&
appInfo
.
mutex
);
tscError
(
"cluster not exist, key:%s"
,
key
);
taosMemoryFree
(
pMsg
->
pData
);
taosMemoryFree
(
pMsg
->
pEpSet
);
tFreeClientHbBatchRsp
(
&
pRsp
);
return
-
1
;
}
...
...
@@ -322,6 +324,7 @@ static int32_t hbAsyncCallBack(void *param, SDataBuf *pMsg, int32_t code) {
tFreeClientHbBatchRsp
(
&
pRsp
);
taosMemoryFree
(
pMsg
->
pData
);
taosMemoryFree
(
pMsg
->
pEpSet
);
return
code
;
}
...
...
source/libs/transport/inc/transComm.h
浏览文件 @
52b28fbc
...
...
@@ -96,7 +96,7 @@ typedef void* queue[2];
//#define TRANS_RETRY_COUNT_LIMIT 100 // retry count limit
//#define TRANS_RETRY_INTERVAL 15 // retry interval (ms)
#define TRANS_CONN_TIMEOUT 3000 // connect timeout (s)
#define TRANS_CONN_TIMEOUT 3000 // connect timeout (
m
s)
#define TRANS_READ_TIMEOUT 3000 // read timeout (ms)
#define TRANS_PACKET_LIMIT 1024 * 1024 * 512
...
...
source/libs/transport/src/transCli.c
浏览文件 @
52b28fbc
...
...
@@ -80,6 +80,7 @@ typedef struct SCliThrd {
uint64_t
nextTimeout
;
// next timeout
void
*
pTransInst
;
//
void
(
*
destroyAhandleFp
)(
void
*
ahandle
);
SHashObj
*
fqdn2ipCache
;
SCvtAddr
cvtAddr
;
...
...
@@ -158,6 +159,7 @@ static void (*cliAsyncHandle[])(SCliMsg* pMsg, SCliThrd* pThrd) = {cliHandleReq,
static
FORCE_INLINE
void
destroyUserdata
(
STransMsg
*
userdata
);
static
FORCE_INLINE
void
destroyCmsg
(
void
*
cmsg
);
static
FORCE_INLINE
void
destroyCmsgAndAhandle
(
void
*
cmsg
);
static
FORCE_INLINE
int
cliRBChoseIdx
(
STrans
*
pTransInst
);
static
FORCE_INLINE
void
transDestroyConnCtx
(
STransConnCtx
*
ctx
);
...
...
@@ -569,7 +571,7 @@ static void addConnToPool(void* pool, SCliConn* conn) {
if
(
conn
->
list
->
size
>=
50
)
{
STaskArg
*
arg
=
taosMemoryCalloc
(
1
,
sizeof
(
STaskArg
));
arg
->
param1
=
conn
;
arg
->
param2
=
NULL
;
arg
->
param2
=
thrd
;
STrans
*
pTransInst
=
thrd
->
pTransInst
;
conn
->
task
=
transDQSched
(
thrd
->
timeoutQueue
,
doCloseIdleConn
,
arg
,
CONN_PERSIST_TIME
(
pTransInst
->
idleTime
));
...
...
@@ -693,8 +695,8 @@ static void cliDestroyConn(SCliConn* conn, bool clear) {
}
if
(
conn
->
timer
!=
NULL
)
{
uv_timer_stop
(
conn
->
timer
);
taosArrayPush
(
pThrd
->
timerList
,
&
conn
->
timer
);
conn
->
timer
->
data
=
NULL
;
taosArrayPush
(
pThrd
->
timerList
,
&
conn
->
timer
);
conn
->
timer
=
NULL
;
}
...
...
@@ -1213,6 +1215,25 @@ static FORCE_INLINE void destroyCmsg(void* arg) {
taosMemoryFree
(
pMsg
);
}
static
FORCE_INLINE
void
destroyCmsgAndAhandle
(
void
*
param
)
{
if
(
param
==
NULL
)
return
;
STaskArg
*
arg
=
param
;
SCliMsg
*
pMsg
=
arg
->
param1
;
SCliThrd
*
pThrd
=
arg
->
param2
;
tDebug
(
"destroy Ahandle A"
);
if
(
pThrd
!=
NULL
&&
pThrd
->
destroyAhandleFp
!=
NULL
)
{
tDebug
(
"destroy Ahandle B"
);
pThrd
->
destroyAhandleFp
(
pMsg
->
ctx
->
ahandle
);
}
tDebug
(
"destroy Ahandle C"
);
transDestroyConnCtx
(
pMsg
->
ctx
);
destroyUserdata
(
&
pMsg
->
msg
);
taosMemoryFree
(
pMsg
);
}
static
SCliThrd
*
createThrdObj
(
void
*
trans
)
{
STrans
*
pTransInst
=
trans
;
...
...
@@ -1247,6 +1268,7 @@ static SCliThrd* createThrdObj(void* trans) {
pThrd
->
nextTimeout
=
taosGetTimestampMs
()
+
CONN_PERSIST_TIME
(
pTransInst
->
idleTime
);
pThrd
->
pTransInst
=
trans
;
pThrd
->
destroyAhandleFp
=
pTransInst
->
destroyFp
;
pThrd
->
fqdn2ipCache
=
taosHashInit
(
4
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
true
,
HASH_NO_LOCK
);
pThrd
->
quit
=
false
;
return
pThrd
;
...
...
@@ -1262,7 +1284,7 @@ static void destroyThrdObj(SCliThrd* pThrd) {
TRANS_DESTROY_ASYNC_POOL_MSG
(
pThrd
->
asyncPool
,
SCliMsg
,
destroyCmsg
);
transAsyncPoolDestroy
(
pThrd
->
asyncPool
);
transDQDestroy
(
pThrd
->
delayQueue
,
destroyCmsg
);
transDQDestroy
(
pThrd
->
delayQueue
,
destroyCmsg
AndAhandle
);
transDQDestroy
(
pThrd
->
timeoutQueue
,
NULL
);
tDebug
(
"thread destroy %"
PRId64
,
pThrd
->
pid
);
...
...
source/libs/transport/src/transComm.c
浏览文件 @
52b28fbc
...
...
@@ -497,7 +497,7 @@ void transDQDestroy(SDelayQueue* queue, void (*freeFunc)(void* arg)) {
SDelayTask
*
task
=
container_of
(
minNode
,
SDelayTask
,
node
);
STaskArg
*
arg
=
task
->
arg
;
if
(
freeFunc
)
freeFunc
(
arg
->
param1
);
if
(
freeFunc
)
freeFunc
(
arg
);
taosMemoryFree
(
arg
);
taosMemoryFree
(
task
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录