Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f97b9721
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看板
提交
f97b9721
编写于
8月 05, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
opt rpc perf
上级
a5420dfa
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
20 deletion
+18
-20
source/libs/transport/src/trans.c
source/libs/transport/src/trans.c
+1
-2
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+15
-17
source/libs/transport/src/transComm.c
source/libs/transport/src/transComm.c
+2
-1
未找到文件。
source/libs/transport/src/trans.c
浏览文件 @
f97b9721
...
...
@@ -80,8 +80,7 @@ void* rpcOpen(const SRpcInit* pInit) {
int64_t
refId
=
transAddExHandle
(
transGetInstMgt
(),
pRpc
);
transAcquireExHandle
(
transGetInstMgt
(),
refId
);
pRpc
->
refId
=
refId
;
return
pRpc
;
// return (void*)refId;
return
(
void
*
)
refId
;
}
void
rpcClose
(
void
*
arg
)
{
tInfo
(
"start to close rpc"
);
...
...
source/libs/transport/src/transCli.c
浏览文件 @
f97b9721
...
...
@@ -564,7 +564,7 @@ static void addConnToPool(void* pool, SCliConn* conn) {
conn
->
task
=
NULL
;
assert
(
!
QUEUE_IS_EMPTY
(
&
conn
->
list
->
conn
));
if
(
conn
->
list
->
size
>=
1
0
)
{
if
(
conn
->
list
->
size
>=
5
0
)
{
STaskArg
*
arg
=
taosMemoryCalloc
(
1
,
sizeof
(
STaskArg
));
arg
->
param1
=
conn
;
arg
->
param2
=
thrd
;
...
...
@@ -1372,7 +1372,7 @@ int transReleaseCliHandle(void* handle) {
}
STransMsg
tmsg
=
{.
info
.
handle
=
handle
};
TRACE_SET_MSGID
(
&
tmsg
.
info
.
traceId
,
tGenIdPI64
());
//
TRACE_SET_MSGID(&tmsg.info.traceId, tGenIdPI64());
SCliMsg
*
cmsg
=
taosMemoryCalloc
(
1
,
sizeof
(
SCliMsg
));
cmsg
->
msg
=
tmsg
;
...
...
@@ -1388,12 +1388,11 @@ int transReleaseCliHandle(void* handle) {
}
int
transSendRequest
(
void
*
shandle
,
const
SEpSet
*
pEpSet
,
STransMsg
*
pReq
,
STransCtx
*
ctx
)
{
// STrans* pTransInst = (STrans*)transAcquireExHandle(transGetInstMgt(), (int64_t)shandle);
// if (pTransInst == NULL) {
// transFreeMsg(pReq->pCont);
// return -1;
// }
STrans
*
pTransInst
=
shandle
;
STrans
*
pTransInst
=
(
STrans
*
)
transAcquireExHandle
(
transGetInstMgt
(),
(
int64_t
)
shandle
);
if
(
pTransInst
==
NULL
)
{
transFreeMsg
(
pReq
->
pCont
);
return
-
1
;
}
bool
valid
=
false
;
SCliThrd
*
pThrd
=
transGetWorkThrd
(
pTransInst
,
(
int64_t
)
pReq
->
info
.
handle
,
&
valid
);
...
...
@@ -1429,23 +1428,22 @@ int transSendRequest(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STran
transReleaseExHandle
(
transGetInstMgt
(),
(
int64_t
)
shandle
);
return
-
1
;
}
//
transReleaseExHandle(transGetInstMgt(), (int64_t)shandle);
transReleaseExHandle
(
transGetInstMgt
(),
(
int64_t
)
shandle
);
return
0
;
}
int
transSendRecv
(
void
*
shandle
,
const
SEpSet
*
pEpSet
,
STransMsg
*
pReq
,
STransMsg
*
pRsp
)
{
STrans
*
pTransInst
=
shandle
;
// STrans* pTransInst = (STrans*)transAcquireExHandle(transGetInstMgt(), (int64_t)shandle);
// if (pTransInst == NULL) {
// transFreeMsg(pReq->pCont);
// return -1;
// }
STrans
*
pTransInst
=
(
STrans
*
)
transAcquireExHandle
(
transGetInstMgt
(),
(
int64_t
)
shandle
);
if
(
pTransInst
==
NULL
)
{
transFreeMsg
(
pReq
->
pCont
);
return
-
1
;
}
bool
valid
=
false
;
SCliThrd
*
pThrd
=
transGetWorkThrd
(
pTransInst
,
(
int64_t
)
pReq
->
info
.
handle
,
&
valid
);
if
(
pThrd
==
NULL
&&
valid
==
false
)
{
transFreeMsg
(
pReq
->
pCont
);
//
transReleaseExHandle(transGetInstMgt(), (int64_t)shandle);
transReleaseExHandle
(
transGetInstMgt
(),
(
int64_t
)
shandle
);
return
-
1
;
}
...
...
@@ -1483,7 +1481,7 @@ int transSendRecv(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STransMs
_RETURN:
tsem_destroy
(
sem
);
taosMemoryFree
(
sem
);
//
transReleaseExHandle(transGetInstMgt(), (int64_t)shandle);
transReleaseExHandle
(
transGetInstMgt
(),
(
int64_t
)
shandle
);
return
ret
;
}
/*
...
...
source/libs/transport/src/transComm.c
浏览文件 @
f97b9721
...
...
@@ -156,7 +156,8 @@ int transAllocBuffer(SConnBuffer* connBuf, uv_buf_t* uvBuf) {
if
(
p
->
left
<
p
->
cap
-
p
->
len
)
{
uvBuf
->
len
=
p
->
left
;
}
else
{
p
->
buf
=
taosMemoryRealloc
(
p
->
buf
,
p
->
left
+
p
->
len
);
p
->
cap
=
p
->
left
+
p
->
len
;
p
->
buf
=
taosMemoryRealloc
(
p
->
buf
,
p
->
cap
);
uvBuf
->
base
=
p
->
buf
+
p
->
len
;
uvBuf
->
len
=
p
->
left
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录