Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
拾光师
TDengine
提交
12687355
T
TDengine
项目概览
拾光师
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
12687355
编写于
10月 06, 2020
作者:
陶建辉(Jeff)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1632
上级
97a50f17
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
22 deletion
+20
-22
src/connector/go
src/connector/go
+1
-1
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+19
-21
未找到文件。
go
@
8c58c512
比较
567b7b12
...
8c58c512
Subproject commit
567b7b12f3fd2775c718d284beffc8c38dd6c219
Subproject commit
8c58c512b6acda8bcdfa48fdc7140227b5221766
src/rpc/src/rpcMain.c
浏览文件 @
12687355
...
@@ -881,6 +881,20 @@ static int rpcProcessRspHead(SRpcConn *pConn, SRpcHead *pHead) {
...
@@ -881,6 +881,20 @@ static int rpcProcessRspHead(SRpcConn *pConn, SRpcHead *pHead) {
pConn
->
outType
=
0
;
pConn
->
outType
=
0
;
pConn
->
pReqMsg
=
NULL
;
pConn
->
pReqMsg
=
NULL
;
pConn
->
reqMsgLen
=
0
;
pConn
->
reqMsgLen
=
0
;
SRpcReqContext
*
pContext
=
pConn
->
pContext
;
if
(
pHead
->
code
==
TSDB_CODE_RPC_REDIRECT
)
{
if
(
rpcContLenFromMsg
(
pHead
->
msgLen
)
<
sizeof
(
SRpcEpSet
))
{
// if EpSet is not included in the msg, treat it as NOT_READY
pHead
->
code
=
TSDB_CODE_RPC_NOT_READY
;
}
else
{
pContext
->
redirect
++
;
if
(
pContext
->
redirect
>
TSDB_MAX_REPLICA
)
{
pHead
->
code
=
TSDB_CODE_RPC_NETWORK_UNAVAIL
;
tWarn
(
"%s, too many redirects, quit"
,
pConn
->
info
);
}
}
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -950,12 +964,6 @@ static SRpcConn *rpcProcessMsgHead(SRpcInfo *pRpc, SRecvInfo *pRecv, SRpcReqCont
...
@@ -950,12 +964,6 @@ static SRpcConn *rpcProcessMsgHead(SRpcInfo *pRpc, SRecvInfo *pRecv, SRpcReqCont
SRpcReqContext
*
pContext
=
pConn
->
pContext
;
SRpcReqContext
*
pContext
=
pConn
->
pContext
;
*
ppContext
=
pContext
;
*
ppContext
=
pContext
;
pConn
->
pContext
=
NULL
;
pConn
->
pContext
=
NULL
;
pConn
->
pReqMsg
=
NULL
;
// for UDP, port may be changed by server, the port in epSet shall be used for cache
if
(
pHead
->
code
!=
TSDB_CODE_RPC_TOO_SLOW
)
{
rpcAddConnIntoCache
(
pRpc
->
pCache
,
pConn
,
pConn
->
peerFqdn
,
pContext
->
epSet
.
port
[
pContext
->
epSet
.
inUse
],
pConn
->
connType
);
}
}
}
}
}
}
}
...
@@ -1083,9 +1091,9 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead, SRpcReqConte
...
@@ -1083,9 +1091,9 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead, SRpcReqConte
rpcMsg
.
pCont
=
pHead
->
content
;
rpcMsg
.
pCont
=
pHead
->
content
;
rpcMsg
.
msgType
=
pHead
->
msgType
;
rpcMsg
.
msgType
=
pHead
->
msgType
;
rpcMsg
.
code
=
pHead
->
code
;
rpcMsg
.
code
=
pHead
->
code
;
rpcMsg
.
ahandle
=
pConn
->
ahandle
;
if
(
rpcIsReq
(
pHead
->
msgType
)
)
{
if
(
rpcIsReq
(
pHead
->
msgType
)
)
{
rpcMsg
.
ahandle
=
pConn
->
ahandle
;
if
(
rpcMsg
.
contLen
>
0
)
{
if
(
rpcMsg
.
contLen
>
0
)
{
rpcMsg
.
handle
=
pConn
;
rpcMsg
.
handle
=
pConn
;
rpcAddRef
(
pRpc
);
// add the refCount for requests
rpcAddRef
(
pRpc
);
// add the refCount for requests
...
@@ -1103,25 +1111,15 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead, SRpcReqConte
...
@@ -1103,25 +1111,15 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead, SRpcReqConte
}
else
{
}
else
{
// it's a response
// it's a response
rpcMsg
.
handle
=
pContext
;
rpcMsg
.
handle
=
pContext
;
rpcMsg
.
ahandle
=
pContext
->
ahandle
;
// for UDP, port may be changed by server, the port in epSet shall be used for cache
// for UDP, port may be changed by server, the port in epSet shall be used for cache
if
(
pHead
->
code
==
TSDB_CODE_RPC_TOO_SLOW
)
{
if
(
pHead
->
code
!=
TSDB_CODE_RPC_TOO_SLOW
)
{
rpcAddConnIntoCache
(
pRpc
->
pCache
,
pConn
,
pConn
->
peerFqdn
,
pContext
->
epSet
.
port
[
pContext
->
epSet
.
inUse
],
pConn
->
connType
);
}
else
{
rpcCloseConn
(
pConn
);
rpcCloseConn
(
pConn
);
}
}
if
(
pHead
->
code
==
TSDB_CODE_RPC_REDIRECT
)
{
if
(
rpcMsg
.
contLen
<
sizeof
(
SRpcEpSet
))
{
// if EpSet is not included in the msg, treat it as NOT_READY
pHead
->
code
=
TSDB_CODE_RPC_NOT_READY
;
}
else
{
pContext
->
redirect
++
;
if
(
pContext
->
redirect
>
TSDB_MAX_REPLICA
)
{
pHead
->
code
=
TSDB_CODE_RPC_NETWORK_UNAVAIL
;
tWarn
(
"%s, too many redirects, quit"
,
pConn
->
info
);
}
}
}
if
(
pHead
->
code
==
TSDB_CODE_RPC_REDIRECT
)
{
if
(
pHead
->
code
==
TSDB_CODE_RPC_REDIRECT
)
{
pContext
->
numOfTry
=
0
;
pContext
->
numOfTry
=
0
;
SRpcEpSet
*
pEpSet
=
(
SRpcEpSet
*
)
pHead
->
content
;
SRpcEpSet
*
pEpSet
=
(
SRpcEpSet
*
)
pHead
->
content
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录