Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5f24bf5b
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5f24bf5b
编写于
4月 19, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh(rpc): add rpc retry
上级
29608b08
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
16 deletion
+19
-16
source/libs/transport/src/transComm.c
source/libs/transport/src/transComm.c
+1
-1
source/libs/transport/src/transSrv.c
source/libs/transport/src/transSrv.c
+18
-15
未找到文件。
source/libs/transport/src/transComm.c
浏览文件 @
5f24bf5b
...
@@ -195,7 +195,7 @@ SAsyncPool* transCreateAsyncPool(uv_loop_t* loop, int sz, void* arg, AsyncCB cb)
...
@@ -195,7 +195,7 @@ SAsyncPool* transCreateAsyncPool(uv_loop_t* loop, int sz, void* arg, AsyncCB cb)
void
transDestroyAsyncPool
(
SAsyncPool
*
pool
)
{
void
transDestroyAsyncPool
(
SAsyncPool
*
pool
)
{
for
(
int
i
=
0
;
i
<
pool
->
nAsync
;
i
++
)
{
for
(
int
i
=
0
;
i
<
pool
->
nAsync
;
i
++
)
{
uv_async_t
*
async
=
&
(
pool
->
asyncs
[
i
]);
uv_async_t
*
async
=
&
(
pool
->
asyncs
[
i
]);
uv_close
((
uv_handle_t
*
)
async
,
NULL
);
//
uv_close((uv_handle_t*)async, NULL);
SAsyncItem
*
item
=
async
->
data
;
SAsyncItem
*
item
=
async
->
data
;
taosThreadMutexDestroy
(
&
item
->
mtx
);
taosThreadMutexDestroy
(
&
item
->
mtx
);
taosMemoryFree
(
item
);
taosMemoryFree
(
item
);
...
...
source/libs/transport/src/transSrv.c
浏览文件 @
5f24bf5b
...
@@ -146,7 +146,8 @@ static void uvHandleQuit(SSrvMsg* msg, SWorkThrdObj* thrd);
...
@@ -146,7 +146,8 @@ static void uvHandleQuit(SSrvMsg* msg, SWorkThrdObj* thrd);
static
void
uvHandleRelease
(
SSrvMsg
*
msg
,
SWorkThrdObj
*
thrd
);
static
void
uvHandleRelease
(
SSrvMsg
*
msg
,
SWorkThrdObj
*
thrd
);
static
void
uvHandleResp
(
SSrvMsg
*
msg
,
SWorkThrdObj
*
thrd
);
static
void
uvHandleResp
(
SSrvMsg
*
msg
,
SWorkThrdObj
*
thrd
);
static
void
uvHandleRegister
(
SSrvMsg
*
msg
,
SWorkThrdObj
*
thrd
);
static
void
uvHandleRegister
(
SSrvMsg
*
msg
,
SWorkThrdObj
*
thrd
);
static
void
(
*
transAsyncHandle
[])(
SSrvMsg
*
msg
,
SWorkThrdObj
*
thrd
)
=
{
uvHandleResp
,
uvHandleQuit
,
uvHandleRelease
,
uvHandleRegister
};
static
void
(
*
transAsyncHandle
[])(
SSrvMsg
*
msg
,
SWorkThrdObj
*
thrd
)
=
{
uvHandleResp
,
uvHandleQuit
,
uvHandleRelease
,
uvHandleRegister
};
static
void
uvDestroyConn
(
uv_handle_t
*
handle
);
static
void
uvDestroyConn
(
uv_handle_t
*
handle
);
...
@@ -209,12 +210,13 @@ static void uvHandleReq(SSrvConn* pConn) {
...
@@ -209,12 +210,13 @@ static void uvHandleReq(SSrvConn* pConn) {
}
}
if
(
pConn
->
status
==
ConnNormal
&&
pHead
->
noResp
==
0
)
{
if
(
pConn
->
status
==
ConnNormal
&&
pHead
->
noResp
==
0
)
{
transRefSrvHandle
(
pConn
);
transRefSrvHandle
(
pConn
);
tDebug
(
"server conn %p %s received from %s:%d, local info: %s:%d, msg size: %d"
,
pConn
,
TMSG_INFO
(
transMsg
.
msgType
),
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
tDebug
(
"server conn %p %s received from %s:%d, local info: %s:%d, msg size: %d"
,
pConn
,
TMSG_INFO
(
transMsg
.
msgType
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetNtoa
(
pConn
->
locaddr
.
sin_addr
),
ntohs
(
pConn
->
locaddr
.
sin_port
),
transMsg
.
contLen
);
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetNtoa
(
pConn
->
locaddr
.
sin_addr
),
ntohs
(
pConn
->
locaddr
.
sin_port
),
transMsg
.
contLen
);
}
else
{
}
else
{
tDebug
(
"server conn %p %s received from %s:%d, local info: %s:%d, msg size: %d, resp:%d "
,
pConn
,
TMSG_INFO
(
transMsg
.
msgType
),
tDebug
(
"server conn %p %s received from %s:%d, local info: %s:%d, msg size: %d, resp:%d "
,
pConn
,
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetNtoa
(
pConn
->
locaddr
.
sin_addr
),
ntohs
(
pConn
->
loc
addr
.
sin_port
),
TMSG_INFO
(
transMsg
.
msgType
),
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
transMsg
.
contLen
,
pHead
->
noResp
);
t
aosInetNtoa
(
pConn
->
locaddr
.
sin_addr
),
ntohs
(
pConn
->
locaddr
.
sin_port
),
t
ransMsg
.
contLen
,
pHead
->
noResp
);
// no ref here
// no ref here
}
}
...
@@ -354,8 +356,9 @@ static void uvPrepareSendData(SSrvMsg* smsg, uv_buf_t* wb) {
...
@@ -354,8 +356,9 @@ static void uvPrepareSendData(SSrvMsg* smsg, uv_buf_t* wb) {
char
*
msg
=
(
char
*
)
pHead
;
char
*
msg
=
(
char
*
)
pHead
;
int32_t
len
=
transMsgLenFromCont
(
pMsg
->
contLen
);
int32_t
len
=
transMsgLenFromCont
(
pMsg
->
contLen
);
tDebug
(
"server conn %p %s is sent to %s:%d, local info: %s:%d"
,
pConn
,
TMSG_INFO
(
pHead
->
msgType
),
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
tDebug
(
"server conn %p %s is sent to %s:%d, local info: %s:%d"
,
pConn
,
TMSG_INFO
(
pHead
->
msgType
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetNtoa
(
pConn
->
locaddr
.
sin_addr
),
ntohs
(
pConn
->
locaddr
.
sin_port
));
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetNtoa
(
pConn
->
locaddr
.
sin_addr
),
ntohs
(
pConn
->
locaddr
.
sin_port
));
pHead
->
msgLen
=
htonl
(
len
);
pHead
->
msgLen
=
htonl
(
len
);
wb
->
base
=
msg
;
wb
->
base
=
msg
;
...
@@ -685,9 +688,9 @@ static void uvDestroyConn(uv_handle_t* handle) {
...
@@ -685,9 +688,9 @@ static void uvDestroyConn(uv_handle_t* handle) {
if
(
thrd
->
quit
&&
QUEUE_IS_EMPTY
(
&
thrd
->
conn
))
{
if
(
thrd
->
quit
&&
QUEUE_IS_EMPTY
(
&
thrd
->
conn
))
{
tTrace
(
"work thread quit"
);
tTrace
(
"work thread quit"
);
//
uv_walk(thrd->loop, uvWalkCb, NULL);
uv_walk
(
thrd
->
loop
,
uvWalkCb
,
NULL
);
uv_loop_close
(
thrd
->
loop
);
//
uv_loop_close(thrd->loop);
uv_stop
(
thrd
->
loop
);
//
uv_stop(thrd->loop);
}
}
}
}
...
@@ -749,9 +752,9 @@ End:
...
@@ -749,9 +752,9 @@ End:
void
uvHandleQuit
(
SSrvMsg
*
msg
,
SWorkThrdObj
*
thrd
)
{
void
uvHandleQuit
(
SSrvMsg
*
msg
,
SWorkThrdObj
*
thrd
)
{
thrd
->
quit
=
true
;
thrd
->
quit
=
true
;
if
(
QUEUE_IS_EMPTY
(
&
thrd
->
conn
))
{
if
(
QUEUE_IS_EMPTY
(
&
thrd
->
conn
))
{
//
uv_walk(thrd->loop, uvWalkCb, NULL);
uv_walk
(
thrd
->
loop
,
uvWalkCb
,
NULL
);
uv_loop_close
(
thrd
->
loop
);
//
uv_loop_close(thrd->loop);
uv_stop
(
thrd
->
loop
);
//
uv_stop(thrd->loop);
}
else
{
}
else
{
destroyAllConn
(
thrd
);
destroyAllConn
(
thrd
);
}
}
...
@@ -802,7 +805,7 @@ void destroyWorkThrd(SWorkThrdObj* pThrd) {
...
@@ -802,7 +805,7 @@ void destroyWorkThrd(SWorkThrdObj* pThrd) {
return
;
return
;
}
}
taosThreadJoin
(
pThrd
->
thread
,
NULL
);
taosThreadJoin
(
pThrd
->
thread
,
NULL
);
//
MAKE_VALGRIND_HAPPY(pThrd->loop);
MAKE_VALGRIND_HAPPY
(
pThrd
->
loop
);
transDestroyAsyncPool
(
pThrd
->
asyncPool
);
transDestroyAsyncPool
(
pThrd
->
asyncPool
);
taosMemoryFree
(
pThrd
->
loop
);
taosMemoryFree
(
pThrd
->
loop
);
taosMemoryFree
(
pThrd
);
taosMemoryFree
(
pThrd
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录