Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0ecd7c70
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看板
未验证
提交
0ecd7c70
编写于
7月 06, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
7月 06, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2575 from taosdata/hotfix/rpcLeak
Hotfix/rpc leak
上级
2418c537
58ecd5c3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
12 deletion
+17
-12
src/dnode/src/dnodeVWrite.c
src/dnode/src/dnodeVWrite.c
+4
-1
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+5
-2
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+8
-9
未找到文件。
src/dnode/src/dnodeVWrite.c
浏览文件 @
0ecd7c70
...
...
@@ -210,6 +210,7 @@ static void *dnodeProcessWriteQueue(void *param) {
int32_t
numOfMsgs
;
int
type
;
void
*
pVnode
,
*
item
;
SRspRet
*
pRspRet
;
dDebug
(
"write worker:%d is running"
,
pWorker
->
workerId
);
...
...
@@ -222,9 +223,11 @@ static void *dnodeProcessWriteQueue(void *param) {
for
(
int32_t
i
=
0
;
i
<
numOfMsgs
;
++
i
)
{
pWrite
=
NULL
;
pRspRet
=
NULL
;
taosGetQitem
(
pWorker
->
qall
,
&
type
,
&
item
);
if
(
type
==
TAOS_QTYPE_RPC
)
{
pWrite
=
(
SWriteMsg
*
)
item
;
pRspRet
=
&
pWrite
->
rspRet
;
pHead
=
(
SWalHead
*
)(
pWrite
->
pCont
-
sizeof
(
SWalHead
));
pHead
->
msgType
=
pWrite
->
rpcMsg
.
msgType
;
pHead
->
version
=
0
;
...
...
@@ -234,7 +237,7 @@ static void *dnodeProcessWriteQueue(void *param) {
pHead
=
(
SWalHead
*
)
item
;
}
int32_t
code
=
vnodeProcessWrite
(
pVnode
,
type
,
pHead
,
item
);
int32_t
code
=
vnodeProcessWrite
(
pVnode
,
type
,
pHead
,
pRspRet
);
if
(
pWrite
)
pWrite
->
rpcMsg
.
code
=
code
;
}
...
...
src/rpc/src/rpcMain.c
浏览文件 @
0ecd7c70
...
...
@@ -538,6 +538,7 @@ void rpcCancelRequest(void *handle) {
if
(
pContext
->
pConn
)
{
tDebug
(
"%s, app trys to cancel request"
,
pContext
->
pConn
->
info
);
pContext
->
pConn
->
pReqMsg
=
NULL
;
rpcCloseConn
(
pContext
->
pConn
);
pContext
->
pConn
=
NULL
;
rpcFreeCont
(
pContext
->
pCont
);
...
...
@@ -601,11 +602,10 @@ static void rpcReleaseConn(SRpcConn *pConn) {
taosHashRemove
(
pRpc
->
hash
,
hashstr
,
size
);
rpcFreeMsg
(
pConn
->
pRspMsg
);
// it may have a response msg saved, but not request msg
pConn
->
pRspMsg
=
NULL
;
if
(
pConn
->
pReqMsg
)
rpcFreeCont
(
pConn
->
pReqMsg
);
}
// memset could not be used, since lockeBy can not be reset
if
(
pConn
->
pReqMsg
)
rpcFreeCont
(
pConn
->
pReqMsg
);
pConn
->
inType
=
0
;
pConn
->
outType
=
0
;
pConn
->
inTranId
=
0
;
...
...
@@ -959,6 +959,7 @@ static void rpcProcessBrokenLink(SRpcConn *pConn) {
if
(
pConn
->
outType
)
{
SRpcReqContext
*
pContext
=
pConn
->
pContext
;
pContext
->
code
=
TSDB_CODE_RPC_NETWORK_UNAVAIL
;
pConn
->
pReqMsg
=
NULL
;
taosTmrStart
(
rpcProcessConnError
,
0
,
pContext
,
pRpc
->
tmrCtrl
);
}
...
...
@@ -1061,6 +1062,7 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) {
SRpcReqContext
*
pContext
=
pConn
->
pContext
;
rpcMsg
.
handle
=
pContext
;
pConn
->
pContext
=
NULL
;
pConn
->
pReqMsg
=
NULL
;
// for UDP, port may be changed by server, the port in ipSet shall be used for cache
if
(
pHead
->
code
!=
TSDB_CODE_RPC_TOO_SLOW
)
{
...
...
@@ -1297,6 +1299,7 @@ static void rpcProcessRetryTimer(void *param, void *tmrId) {
tDebug
(
"%s, failed to send msg:%s to %s:%hu"
,
pConn
->
info
,
taosMsg
[
pConn
->
outType
],
pConn
->
peerFqdn
,
pConn
->
peerPort
);
if
(
pConn
->
pContext
)
{
pConn
->
pContext
->
code
=
TSDB_CODE_RPC_NETWORK_UNAVAIL
;
pConn
->
pReqMsg
=
NULL
;
taosTmrStart
(
rpcProcessConnError
,
0
,
pConn
->
pContext
,
pRpc
->
tmrCtrl
);
rpcReleaseConn
(
pConn
);
}
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
0ecd7c70
...
...
@@ -97,18 +97,17 @@ void vnodeConfirmForward(void *param, uint64_t version, int32_t code) {
static
int32_t
vnodeProcessSubmitMsg
(
SVnodeObj
*
pVnode
,
void
*
pCont
,
SRspRet
*
pRet
)
{
int32_t
code
=
TSDB_CODE_SUCCESS
;
vTrace
(
"vgId:%d, submit msg is processed"
,
pVnode
->
vgId
);
// save insert result into item
SShellSubmitRspMsg
*
pRsp
=
NULL
;
if
(
pRet
)
{
pRet
->
len
=
sizeof
(
SShellSubmitRspMsg
);
pRet
->
rsp
=
rpcMallocCont
(
pRet
->
len
);
pRsp
=
pRet
->
rsp
;
}
vTrace
(
"vgId:%d, submit msg is processed"
,
pVnode
->
vgId
);
pRet
->
len
=
sizeof
(
SShellSubmitRspMsg
);
pRet
->
rsp
=
rpcMallocCont
(
pRet
->
len
);
SShellSubmitRspMsg
*
pRsp
=
pRet
->
rsp
;
if
(
tsdbInsertData
(
pVnode
->
tsdb
,
pCont
,
pRsp
)
<
0
)
code
=
terrno
;
pRsp
->
numOfFailedBlocks
=
0
;
//TODO
//pRet->len += pRsp->numOfFailedBlocks * sizeof(SShellSubmitRspBlock); //TODO
pRsp
->
code
=
0
;
pRsp
->
numOfRows
=
htonl
(
1
);
return
code
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录