Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f5db4a8b
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,发现更多精彩内容 >>
提交
f5db4a8b
编写于
11月 28, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change paramter
上级
f3c1eb82
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
41 addition
and
35 deletion
+41
-35
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+41
-35
未找到文件。
source/libs/transport/src/transCli.c
浏览文件 @
f5db4a8b
...
@@ -1416,13 +1416,19 @@ FORCE_INLINE bool cliTryExtractEpSet(STransMsg* pResp, SEpSet* dst) {
...
@@ -1416,13 +1416,19 @@ FORCE_INLINE bool cliTryExtractEpSet(STransMsg* pResp, SEpSet* dst) {
bool
cliResetEpset
(
STransConnCtx
*
pCtx
,
STransMsg
*
pResp
,
bool
hasEpSet
)
{
bool
cliResetEpset
(
STransConnCtx
*
pCtx
,
STransMsg
*
pResp
,
bool
hasEpSet
)
{
bool
noDelay
=
true
;
bool
noDelay
=
true
;
if
(
hasEpSet
==
false
)
{
if
(
hasEpSet
==
false
)
{
assert
(
pResp
->
contLen
==
0
);
//
assert(pResp->contLen == 0);
if
(
pResp
->
contLen
==
0
)
{
if
(
pResp
->
contLen
==
0
)
{
if
(
pCtx
->
epsetRetryCnt
>=
pCtx
->
epSet
.
numOfEps
)
{
if
(
pCtx
->
epsetRetryCnt
>=
pCtx
->
epSet
.
numOfEps
)
{
noDelay
=
false
;
noDelay
=
false
;
}
else
{
}
else
{
EPSET_FORWARD_INUSE
(
&
pCtx
->
epSet
);
EPSET_FORWARD_INUSE
(
&
pCtx
->
epSet
);
}
}
}
else
{
if
(
pCtx
->
epsetRetryCnt
>=
pCtx
->
epSet
.
numOfEps
)
{
noDelay
=
false
;
}
else
{
EPSET_FORWARD_INUSE
(
&
pCtx
->
epSet
);
}
}
}
}
else
{
}
else
{
SEpSet
epSet
;
SEpSet
epSet
;
...
@@ -1433,17 +1439,19 @@ bool cliResetEpset(STransConnCtx* pCtx, STransMsg* pResp, bool hasEpSet) {
...
@@ -1433,17 +1439,19 @@ bool cliResetEpset(STransConnCtx* pCtx, STransMsg* pResp, bool hasEpSet) {
noDelay
=
false
;
noDelay
=
false
;
}
else
{
}
else
{
EPSET_FORWARD_INUSE
(
&
pCtx
->
epSet
);
EPSET_FORWARD_INUSE
(
&
pCtx
->
epSet
);
noDelay
=
true
;
}
}
}
else
{
}
else
{
if
(
!
transEpSetIsEqual
(
&
pCtx
->
epSet
,
&
epSet
))
{
if
(
!
transEpSetIsEqual
(
&
pCtx
->
epSet
,
&
epSet
))
{
tDebug
(
"epset not equal, retry new epset"
);
tDebug
(
"epset not equal, retry new epset"
);
pCtx
->
epSet
=
epSet
;
pCtx
->
epSet
=
epSet
;
}
else
{
}
else
{
tDebug
(
"epset equal, continue"
);
if
(
pCtx
->
epsetRetryCnt
>=
pCtx
->
epSet
.
numOfEps
)
{
EPSET_FORWARD_INUSE
(
&
pCtx
->
epSet
);
noDelay
=
false
;
}
else
{
tDebug
(
"epset equal, continue"
);
EPSET_FORWARD_INUSE
(
&
pCtx
->
epSet
);
}
}
}
noDelay
=
false
;
}
}
}
}
return
noDelay
;
return
noDelay
;
...
@@ -1459,14 +1467,22 @@ bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
...
@@ -1459,14 +1467,22 @@ bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
if
(
retry
==
false
)
{
if
(
retry
==
false
)
{
return
false
;
return
false
;
}
}
if
(
pCtx
->
retryInit
)
{
if
(
-
1
!=
pCtx
->
retryMaxTimeout
&&
taosGetTimestampMs
()
-
pCtx
->
retryInitTimestamp
>=
pCtx
->
retryMaxTimeout
)
{
if
(
!
pCtx
->
retryInit
)
{
return
false
;
pCtx
->
retryMinInterval
=
pTransInst
->
retryMinInterval
;
}
pCtx
->
retryMaxInterval
=
pTransInst
->
retryMaxInterval
;
pCtx
->
retryStepFactor
=
pTransInst
->
retryStepFactor
;
pCtx
->
retryMaxTimeout
=
pTransInst
->
retryMaxTimouet
;
pCtx
->
retryInitTimestamp
=
taosGetTimestampMs
();
pCtx
->
retryNextInterval
=
pCtx
->
retryMinInterval
;
pCtx
->
retryStep
=
1
;
pCtx
->
retryInit
=
true
;
}
if
(
-
1
!=
pCtx
->
retryMaxTimeout
&&
taosGetTimestampMs
()
-
pCtx
->
retryInitTimestamp
>=
pCtx
->
retryMaxTimeout
)
{
return
false
;
}
}
bool
noDelay
=
false
;
bool
noDelay
=
false
;
if
(
code
==
TSDB_CODE_RPC_BROKEN_LINK
||
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
)
{
if
(
code
==
TSDB_CODE_RPC_BROKEN_LINK
||
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
)
{
tDebug
(
"code str %s, contlen:%d 0"
,
tstrerror
(
code
),
pResp
->
contLen
);
tDebug
(
"code str %s, contlen:%d 0"
,
tstrerror
(
code
),
pResp
->
contLen
);
noDelay
=
cliResetEpset
(
pCtx
,
pResp
,
false
);
noDelay
=
cliResetEpset
(
pCtx
,
pResp
,
false
);
...
@@ -1490,34 +1506,24 @@ bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
...
@@ -1490,34 +1506,24 @@ bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
transFreeMsg
(
pResp
->
pCont
);
transFreeMsg
(
pResp
->
pCont
);
}
}
if
(
!
pCtx
->
retryInit
)
{
if
(
noDelay
==
false
)
{
pCtx
->
retryMinInterval
=
pTransInst
->
retryMinInterval
;
pCtx
->
epsetRetryCnt
=
1
;
pCtx
->
retryMaxInterval
=
pTransInst
->
retryMaxInterval
;
pCtx
->
retryStep
++
;
pCtx
->
retryStepFactor
=
pTransInst
->
retryStepFactor
;
pCtx
->
retryMaxTimeout
=
pTransInst
->
retryMaxTimouet
;
pCtx
->
retryInitTimestamp
=
taosGetTimestampMs
();
pCtx
->
retryNextInterval
=
pCtx
->
retryMinInterval
;
pCtx
->
retryStep
=
1
;
pCtx
->
retryInit
=
true
;
}
else
{
if
(
noDelay
==
false
)
{
pCtx
->
epsetRetryCnt
=
0
;
pCtx
->
retryStep
++
;
int64_t
factor
=
pow
(
pCtx
->
retryStepFactor
,
pCtx
->
retryStep
-
1
);
pCtx
->
retryNextInterval
=
factor
*
pCtx
->
retryMinInterval
;
if
(
pCtx
->
retryNextInterval
>=
pCtx
->
retryMaxInterval
)
{
pCtx
->
retryNextInterval
=
pCtx
->
retryMaxInterval
;
}
if
(
-
1
!=
pCtx
->
retryMaxTimeout
&&
taosGetTimestampMs
()
-
pCtx
->
retryInitTimestamp
>=
pCtx
->
retryMaxTimeout
)
{
int64_t
factor
=
pow
(
pCtx
->
retryStepFactor
,
pCtx
->
retryStep
-
1
);
return
false
;
pCtx
->
retryNextInterval
=
factor
*
pCtx
->
retryMinInterval
;
}
if
(
pCtx
->
retryNextInterval
>=
pCtx
->
retryMaxInterval
)
{
}
else
{
pCtx
->
retryNextInterval
=
pCtx
->
retryMaxInterval
;
pCtx
->
retryNextInterval
=
0
;
}
pCtx
->
epsetRetryCnt
++
;
if
(
-
1
!=
pCtx
->
retryMaxTimeout
&&
taosGetTimestampMs
()
-
pCtx
->
retryInitTimestamp
>=
pCtx
->
retryMaxTimeout
)
{
return
false
;
}
}
}
else
{
pCtx
->
retryNextInterval
=
0
;
pCtx
->
epsetRetryCnt
++
;
}
}
pMsg
->
sent
=
0
;
pMsg
->
sent
=
0
;
cliSchedMsgToNextNode
(
pMsg
,
pThrd
);
cliSchedMsgToNextNode
(
pMsg
,
pThrd
);
return
true
;
return
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录