Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0c534273
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看板
提交
0c534273
编写于
6月 28, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: refactor rpc code
上级
ddf0ff11
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
11 addition
and
11 deletion
+11
-11
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
+5
-5
source/libs/transport/src/transComm.c
source/libs/transport/src/transComm.c
+1
-1
source/libs/transport/src/transSvr.c
source/libs/transport/src/transSvr.c
+4
-4
未找到文件。
source/libs/transport/inc/transComm.h
浏览文件 @
0c534273
...
...
@@ -229,7 +229,7 @@ typedef struct {
SAsyncPool
*
transCreateAsyncPool
(
uv_loop_t
*
loop
,
int
sz
,
void
*
arg
,
AsyncCB
cb
);
void
transDestroyAsyncPool
(
SAsyncPool
*
pool
);
int
trans
SendAsync
(
SAsyncPool
*
pool
,
queue
*
mq
);
int
trans
AsyncSend
(
SAsyncPool
*
pool
,
queue
*
mq
);
#define TRANS_DESTROY_ASYNC_POOL_MSG(pool, msgType, freeFunc) \
do { \
...
...
source/libs/transport/src/transCli.c
浏览文件 @
0c534273
...
...
@@ -967,7 +967,7 @@ void cliSendQuit(SCliThrd* thrd) {
// cli can stop gracefully
SCliMsg
*
msg
=
taosMemoryCalloc
(
1
,
sizeof
(
SCliMsg
));
msg
->
type
=
Quit
;
trans
SendAsync
(
thrd
->
asyncPool
,
&
msg
->
q
);
trans
AsyncSend
(
thrd
->
asyncPool
,
&
msg
->
q
);
}
void
cliWalkCb
(
uv_handle_t
*
handle
,
void
*
arg
)
{
if
(
!
uv_is_closing
(
handle
))
{
...
...
@@ -1138,7 +1138,7 @@ void transReleaseCliHandle(void* handle) {
cmsg
->
msg
=
tmsg
;
cmsg
->
type
=
Release
;
trans
SendAsync
(
pThrd
->
asyncPool
,
&
cmsg
->
q
);
trans
AsyncSend
(
pThrd
->
asyncPool
,
&
cmsg
->
q
);
return
;
}
...
...
@@ -1171,7 +1171,7 @@ void transSendRequest(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STra
STraceId
*
trace
=
&
pReq
->
info
.
traceId
;
tGTrace
(
"%s send request at thread:%08"
PRId64
", dst: %s:%d, app:%p"
,
transLabel
(
pTransInst
),
pThrd
->
pid
,
EPSET_GET_INUSE_IP
(
&
pCtx
->
epSet
),
EPSET_GET_INUSE_PORT
(
&
pCtx
->
epSet
),
pReq
->
info
.
ahandle
);
ASSERT
(
trans
SendAsync
(
pThrd
->
asyncPool
,
&
(
cliMsg
->
q
))
==
0
);
ASSERT
(
trans
AsyncSend
(
pThrd
->
asyncPool
,
&
(
cliMsg
->
q
))
==
0
);
return
;
}
...
...
@@ -1205,7 +1205,7 @@ void transSendRecv(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STransM
tGTrace
(
"%s send request at thread:%08"
PRId64
", dst: %s:%d, app:%p"
,
transLabel
(
pTransInst
),
pThrd
->
pid
,
EPSET_GET_INUSE_IP
(
&
pCtx
->
epSet
),
EPSET_GET_INUSE_PORT
(
&
pCtx
->
epSet
),
pReq
->
info
.
ahandle
);
trans
SendAsync
(
pThrd
->
asyncPool
,
&
(
cliMsg
->
q
));
trans
AsyncSend
(
pThrd
->
asyncPool
,
&
(
cliMsg
->
q
));
tsem_wait
(
sem
);
tsem_destroy
(
sem
);
taosMemoryFree
(
sem
);
...
...
@@ -1234,7 +1234,7 @@ void transSetDefaultAddr(void* shandle, const char* ip, const char* fqdn) {
SCliThrd
*
thrd
=
((
SCliObj
*
)
pTransInst
->
tcphandle
)
->
pThreadObj
[
i
];
tDebug
(
"%s update epset at thread:%08"
PRId64
""
,
pTransInst
->
label
,
thrd
->
pid
);
trans
SendAsync
(
thrd
->
asyncPool
,
&
(
cliMsg
->
q
));
trans
AsyncSend
(
thrd
->
asyncPool
,
&
(
cliMsg
->
q
));
}
}
#endif
source/libs/transport/src/transComm.c
浏览文件 @
0c534273
...
...
@@ -202,7 +202,7 @@ void transDestroyAsyncPool(SAsyncPool* pool) {
taosMemoryFree
(
pool
->
asyncs
);
taosMemoryFree
(
pool
);
}
int
trans
SendAsync
(
SAsyncPool
*
pool
,
queue
*
q
)
{
int
trans
AsyncSend
(
SAsyncPool
*
pool
,
queue
*
q
)
{
int
idx
=
pool
->
index
;
idx
=
idx
%
pool
->
nAsync
;
// no need mutex here
...
...
source/libs/transport/src/transSvr.c
浏览文件 @
0c534273
...
...
@@ -999,7 +999,7 @@ void sendQuitToWorkThrd(SWorkThrd* pThrd) {
SSvrMsg
*
msg
=
taosMemoryCalloc
(
1
,
sizeof
(
SSvrMsg
));
msg
->
type
=
Quit
;
tDebug
(
"server send quit msg to work thread"
);
trans
SendAsync
(
pThrd
->
asyncPool
,
&
msg
->
q
);
trans
AsyncSend
(
pThrd
->
asyncPool
,
&
msg
->
q
);
}
void
transCloseServer
(
void
*
arg
)
{
...
...
@@ -1070,7 +1070,7 @@ void transReleaseSrvHandle(void* handle) {
m
->
type
=
Release
;
tTrace
(
"%s conn %p start to release"
,
transLabel
(
pThrd
->
pTransInst
),
exh
->
handle
);
trans
SendAsync
(
pThrd
->
asyncPool
,
&
m
->
q
);
trans
AsyncSend
(
pThrd
->
asyncPool
,
&
m
->
q
);
transReleaseExHandle
(
refMgt
,
refId
);
return
;
_return1:
...
...
@@ -1099,7 +1099,7 @@ void transSendResponse(const STransMsg* msg) {
STraceId
*
trace
=
(
STraceId
*
)
&
msg
->
info
.
traceId
;
tGTrace
(
"conn %p start to send resp (1/2)"
,
exh
->
handle
);
trans
SendAsync
(
pThrd
->
asyncPool
,
&
m
->
q
);
trans
AsyncSend
(
pThrd
->
asyncPool
,
&
m
->
q
);
transReleaseExHandle
(
refMgt
,
refId
);
return
;
_return1:
...
...
@@ -1128,7 +1128,7 @@ void transRegisterMsg(const STransMsg* msg) {
m
->
type
=
Register
;
tTrace
(
"%s conn %p start to register brokenlink callback"
,
transLabel
(
pThrd
->
pTransInst
),
exh
->
handle
);
trans
SendAsync
(
pThrd
->
asyncPool
,
&
m
->
q
);
trans
AsyncSend
(
pThrd
->
asyncPool
,
&
m
->
q
);
transReleaseExHandle
(
refMgt
,
refId
);
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录