Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ffd105d0
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ffd105d0
编写于
6月 23, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
handle except
上级
23d1e557
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
32 addition
and
29 deletion
+32
-29
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+29
-26
source/libs/transport/src/transComm.c
source/libs/transport/src/transComm.c
+3
-3
未找到文件。
source/libs/transport/src/transCli.c
浏览文件 @
ffd105d0
...
...
@@ -393,7 +393,6 @@ void cliHandleExcept(SCliConn* pConn) {
transMsg
.
code
=
TSDB_CODE_RPC_NETWORK_UNAVAIL
;
transMsg
.
msgType
=
pMsg
?
pMsg
->
msg
.
msgType
+
1
:
0
;
transMsg
.
info
.
ahandle
=
NULL
;
transMsg
.
info
.
handle
=
pConn
;
if
(
pMsg
==
NULL
&&
!
CONN_NO_PERSIST_BY_APP
(
pConn
))
{
transMsg
.
info
.
ahandle
=
transCtxDumpVal
(
&
pConn
->
ctx
,
transMsg
.
msgType
);
...
...
@@ -987,10 +986,14 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
if
(
pCtx
->
retryCount
==
0
)
{
pCtx
->
origEpSet
=
pCtx
->
epSet
;
}
/*
* upper layer handle retry if code equal TSDB_CODE_RPC_NETWORK_UNAVAIL
*/
/*
* no retry
* 1. query conn 2. rpc thread already receive quit msg
*
*/
if
(
CONN_NO_PERSIST_BY_APP
(
pConn
)
&&
pThrd
->
quit
==
false
)
{
tmsg_t
msgType
=
pCtx
->
msgType
;
if
((
pTransInst
->
retry
!=
NULL
&&
pEpSet
->
numOfEps
>
1
&&
(
pTransInst
->
retry
(
pResp
->
code
)))
||
...
...
@@ -1014,31 +1017,31 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
transUnrefCliHandle
(
pConn
);
return
-
1
;
}
else
if
(
pCtx
->
retryCount
<
TRANS_RETRY_COUNT_LIMIT
)
{
if
(
pResp
->
contLen
==
0
)
{
pEpSet
->
inUse
=
(
++
pEpSet
->
inUse
)
%
pEpSet
->
numOfEps
;
transPrintEpSet
(
&
pCtx
->
epSet
);
tTrace
(
"%s use local epset, inUse: %d, retry count:%d, limit: %d"
,
pTransInst
->
label
,
pEpSet
->
inUse
,
pCtx
->
retryCount
+
1
,
TRANS_RETRY_COUNT_LIMIT
);
}
else
{
SEpSet
epSet
=
{
0
};
tDeserializeSEpSet
(
pResp
->
pCont
,
pResp
->
contLen
,
&
epSet
);
pCtx
->
epSet
=
epSet
;
transPrintEpSet
(
&
pCtx
->
epSet
);
tTrace
(
"%s use remote epset, inUse: %d, retry count:%d, limit: %d"
,
pTransInst
->
label
,
pEpSet
->
inUse
,
pCtx
->
retryCount
+
1
,
TRANS_RETRY_COUNT_LIMIT
);
}
if
(
pConn
->
status
!=
ConnInPool
)
{
addConnToPool
(
pThrd
->
pool
,
pConn
);
}
STaskArg
*
arg
=
taosMemoryMalloc
(
sizeof
(
STaskArg
));
arg
->
param1
=
pMsg
;
arg
->
param2
=
pThrd
;
transDQSched
(
pThrd
->
delayQueue
,
doDelayTask
,
arg
,
TRANS_RETRY_INTERVAL
);
return
-
1
;
}
}
else
if
(
pCtx
->
retryCount
<
TRANS_RETRY_COUNT_LIMIT
)
{
if
(
pResp
->
contLen
==
0
)
{
pEpSet
->
inUse
=
(
++
pEpSet
->
inUse
)
%
pEpSet
->
numOfEps
;
transPrintEpSet
(
&
pCtx
->
epSet
);
tTrace
(
"%s use local epset, inUse: %d, retry count:%d, limit: %d"
,
pTransInst
->
label
,
pEpSet
->
inUse
,
pCtx
->
retryCount
+
1
,
TRANS_RETRY_COUNT_LIMIT
);
}
else
{
SEpSet
epSet
=
{
0
};
tDeserializeSEpSet
(
pResp
->
pCont
,
pResp
->
contLen
,
&
epSet
);
pCtx
->
epSet
=
epSet
;
transPrintEpSet
(
&
pCtx
->
epSet
);
tTrace
(
"%s use remote epset, inUse: %d, retry count:%d, limit: %d"
,
pTransInst
->
label
,
pEpSet
->
inUse
,
pCtx
->
retryCount
+
1
,
TRANS_RETRY_COUNT_LIMIT
);
}
if
(
pConn
->
status
!=
ConnInPool
)
{
addConnToPool
(
pThrd
->
pool
,
pConn
);
}
STaskArg
*
arg
=
taosMemoryMalloc
(
sizeof
(
STaskArg
));
arg
->
param1
=
pMsg
;
arg
->
param2
=
pThrd
;
transDQSched
(
pThrd
->
delayQueue
,
doDelayTask
,
arg
,
TRANS_RETRY_INTERVAL
);
return
-
1
;
}
}
}
...
...
source/libs/transport/src/transComm.c
浏览文件 @
ffd105d0
...
...
@@ -455,16 +455,16 @@ void transPrintEpSet(SEpSet* pEpSet) {
return
;
}
char
buf
[
512
]
=
{
0
};
int
len
=
snprintf
(
buf
,
sizeof
(
buf
),
"epset:{
"
);
int
len
=
snprintf
(
buf
,
sizeof
(
buf
),
"epset:{"
);
for
(
int
i
=
0
;
i
<
pEpSet
->
numOfEps
;
i
++
)
{
if
(
i
==
pEpSet
->
numOfEps
-
1
)
{
len
+=
snprintf
(
buf
+
len
,
sizeof
(
buf
)
-
len
,
"%d. %s:%d
"
,
i
,
pEpSet
->
eps
[
i
].
fqdn
,
pEpSet
->
eps
[
i
].
port
);
len
+=
snprintf
(
buf
+
len
,
sizeof
(
buf
)
-
len
,
"%d. %s:%d"
,
i
,
pEpSet
->
eps
[
i
].
fqdn
,
pEpSet
->
eps
[
i
].
port
);
}
else
{
len
+=
snprintf
(
buf
+
len
,
sizeof
(
buf
)
-
len
,
"%d. %s:%d, "
,
i
,
pEpSet
->
eps
[
i
].
fqdn
,
pEpSet
->
eps
[
i
].
port
);
}
}
len
+=
snprintf
(
buf
+
len
,
sizeof
(
buf
)
-
len
,
"}"
);
tTrace
(
"%s, inUse:
%d"
,
buf
,
pEpSet
->
inUse
);
tTrace
(
"%s, inUse:%d"
,
buf
,
pEpSet
->
inUse
);
}
bool
transEpSetIsEqual
(
SEpSet
*
a
,
SEpSet
*
b
)
{
if
(
a
->
numOfEps
!=
b
->
numOfEps
||
a
->
inUse
!=
b
->
inUse
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录