Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5b327d25
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
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看板
提交
5b327d25
编写于
8月 15, 2022
作者:
A
Alex Duan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fit(rpc): TCP probe msg if pConn is null set alive
上级
1c36c692
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
9 deletion
+26
-9
src/client/src/tscServer.c
src/client/src/tscServer.c
+17
-5
src/inc/trpc.h
src/inc/trpc.h
+1
-1
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+8
-3
未找到文件。
src/client/src/tscServer.c
浏览文件 @
5b327d25
...
@@ -282,7 +282,7 @@ void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) {
...
@@ -282,7 +282,7 @@ void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) {
}
}
// if return true, send probe connection msg to sever ok
// if return true, send probe connection msg to sever ok
bool
sendProbeConnMsg
(
SSqlObj
*
pSql
,
int64_t
stime
)
{
bool
sendProbeConnMsg
(
SSqlObj
*
pSql
,
int64_t
stime
,
bool
*
pReqOver
)
{
if
(
stime
==
0
)
{
if
(
stime
==
0
)
{
// not start , no need probe
// not start , no need probe
tscInfo
(
"PROBE 0x%"
PRIx64
" not start, no need probe."
,
pSql
->
self
);
tscInfo
(
"PROBE 0x%"
PRIx64
" not start, no need probe."
,
pSql
->
self
);
...
@@ -318,8 +318,9 @@ bool sendProbeConnMsg(SSqlObj* pSql, int64_t stime) {
...
@@ -318,8 +318,9 @@ bool sendProbeConnMsg(SSqlObj* pSql, int64_t stime) {
return
true
;
return
true
;
}
}
bool
ret
=
rpcSendProbe
(
pSql
->
rpcRid
,
pSql
->
pPrevContext
);
bool
ret
=
rpcSendProbe
(
pSql
->
rpcRid
,
pSql
->
pPrevContext
,
pReqOver
);
tscInfo
(
"PROBE 0x%"
PRIx64
" send probe msg, ret=%d rpcRid=0x%"
PRIx64
,
pSql
->
self
,
ret
,
pSql
->
rpcRid
);
if
(
!
(
*
pReqOver
))
tscInfo
(
"PROBE 0x%"
PRIx64
" send probe msg, ret=%d rpcRid=0x%"
PRIx64
,
pSql
->
self
,
ret
,
pSql
->
rpcRid
);
return
ret
;
return
ret
;
}
}
...
@@ -335,16 +336,22 @@ void checkBrokenQueries(STscObj *pTscObj) {
...
@@ -335,16 +336,22 @@ void checkBrokenQueries(STscObj *pTscObj) {
}
}
bool
kill
=
false
;
bool
kill
=
false
;
bool
reqOver
=
false
;
int32_t
numOfSub
=
pSql
->
subState
.
numOfSub
;
int32_t
numOfSub
=
pSql
->
subState
.
numOfSub
;
tscInfo
(
"PROBE 0x%"
PRIx64
" start checking sql alive, numOfSub=%d sql=%s stime=%"
PRId64
" alive=%"
PRId64
" rpcRid=0x%"
PRIx64
\
tscInfo
(
"PROBE 0x%"
PRIx64
" start checking sql alive, numOfSub=%d sql=%s stime=%"
PRId64
" alive=%"
PRId64
" rpcRid=0x%"
PRIx64
\
,
pSql
->
self
,
numOfSub
,
pSql
->
sqlstr
==
NULL
?
""
:
pSql
->
sqlstr
,
pSql
->
stime
,
pSql
->
lastAlive
,
pSql
->
rpcRid
);
,
pSql
->
self
,
numOfSub
,
pSql
->
sqlstr
==
NULL
?
""
:
pSql
->
sqlstr
,
pSql
->
stime
,
pSql
->
lastAlive
,
pSql
->
rpcRid
);
if
(
numOfSub
==
0
)
{
if
(
numOfSub
==
0
)
{
// no sub sql
// no sub sql
if
(
!
sendProbeConnMsg
(
pSql
,
pSql
->
stime
))
{
if
(
!
sendProbeConnMsg
(
pSql
,
pSql
->
stime
,
&
reqOver
))
{
// need kill
// need kill
tscInfo
(
"PROBE 0x%"
PRIx64
" need break link done. rpcRid=0x%"
PRIx64
,
pSql
->
self
,
pSql
->
rpcRid
);
tscInfo
(
"PROBE 0x%"
PRIx64
" need break link done. rpcRid=0x%"
PRIx64
,
pSql
->
self
,
pSql
->
rpcRid
);
kill
=
true
;
kill
=
true
;
}
}
if
(
reqOver
)
{
// current request is finished over, so upate alive to now
pSql
->
lastAlive
=
taosGetTimestampMs
();
}
}
else
{
}
else
{
// lock subs
// lock subs
pthread_mutex_lock
(
&
pSql
->
subState
.
mutex
);
pthread_mutex_lock
(
&
pSql
->
subState
.
mutex
);
...
@@ -354,12 +361,17 @@ void checkBrokenQueries(STscObj *pTscObj) {
...
@@ -354,12 +361,17 @@ void checkBrokenQueries(STscObj *pTscObj) {
SSqlObj
*
pSubSql
=
pSql
->
pSubs
[
i
];
SSqlObj
*
pSubSql
=
pSql
->
pSubs
[
i
];
if
(
pSubSql
)
{
if
(
pSubSql
)
{
tscInfo
(
"PROBE 0x%"
PRIx64
" sub sql app is 0x%"
PRIx64
,
pSql
->
self
,
pSubSql
->
self
);
tscInfo
(
"PROBE 0x%"
PRIx64
" sub sql app is 0x%"
PRIx64
,
pSql
->
self
,
pSubSql
->
self
);
if
(
!
sendProbeConnMsg
(
pSubSql
,
pSql
->
stime
))
{
if
(
!
sendProbeConnMsg
(
pSubSql
,
pSql
->
stime
,
&
reqOver
))
{
// need kill
// need kill
tscInfo
(
"PROBE 0x%"
PRIx64
" i=%d sub app=0x%"
PRIx64
" need break link done. rpcRid=0x%"
PRIx64
,
pSql
->
self
,
i
,
pSubSql
->
self
,
pSubSql
->
rpcRid
);
tscInfo
(
"PROBE 0x%"
PRIx64
" i=%d sub app=0x%"
PRIx64
" need break link done. rpcRid=0x%"
PRIx64
,
pSql
->
self
,
i
,
pSubSql
->
self
,
pSubSql
->
rpcRid
);
kill
=
true
;
kill
=
true
;
break
;
break
;
}
}
if
(
reqOver
)
{
// current request is finished over, so upate alive to now
pSubSql
->
lastAlive
=
taosGetTimestampMs
();
}
}
}
}
}
}
}
...
...
src/inc/trpc.h
浏览文件 @
5b327d25
...
@@ -93,7 +93,7 @@ void rpcSendRecv(void *shandle, SRpcEpSet *pEpSet, SRpcMsg *pReq, SRpcMsg *pRsp
...
@@ -93,7 +93,7 @@ void rpcSendRecv(void *shandle, SRpcEpSet *pEpSet, SRpcMsg *pReq, SRpcMsg *pRsp
int
rpcReportProgress
(
void
*
pConn
,
char
*
pCont
,
int
contLen
);
int
rpcReportProgress
(
void
*
pConn
,
char
*
pCont
,
int
contLen
);
void
rpcCancelRequest
(
int64_t
rid
);
void
rpcCancelRequest
(
int64_t
rid
);
// send rpc Refid connection probe alive message
// send rpc Refid connection probe alive message
bool
rpcSendProbe
(
int64_t
rpcRid
,
void
*
pPrevContext
);
bool
rpcSendProbe
(
int64_t
rpcRid
,
void
*
pPrevContext
,
bool
*
pReqOver
);
// after sql request send , save conn info
// after sql request send , save conn info
bool
rpcSaveSendInfo
(
int64_t
rpcRid
,
void
**
ppContext
);
bool
rpcSaveSendInfo
(
int64_t
rpcRid
,
void
**
ppContext
);
...
...
src/rpc/src/rpcMain.c
浏览文件 @
5b327d25
...
@@ -1784,7 +1784,7 @@ bool doRpcSendProbe(SRpcConn *pConn) {
...
@@ -1784,7 +1784,7 @@ bool doRpcSendProbe(SRpcConn *pConn) {
}
}
// send server syn
// send server syn
bool
rpcSendProbe
(
int64_t
rpcRid
,
void
*
pPrevContext
)
{
bool
rpcSendProbe
(
int64_t
rpcRid
,
void
*
pPrevContext
,
bool
*
pReqOver
)
{
// return false can kill query
// return false can kill query
bool
ret
=
false
;
bool
ret
=
false
;
if
(
rpcRid
<
0
)
{
if
(
rpcRid
<
0
)
{
...
@@ -1807,7 +1807,9 @@ bool rpcSendProbe(int64_t rpcRid, void* pPrevContext) {
...
@@ -1807,7 +1807,9 @@ bool rpcSendProbe(int64_t rpcRid, void* pPrevContext) {
// conn same
// conn same
if
(
pContext
->
pConn
==
NULL
)
{
if
(
pContext
->
pConn
==
NULL
)
{
tInfo
(
"PROBE rpcRid=0x%"
PRIx64
" connect obj is NULL. "
,
rpcRid
);
tInfo
(
"PROBE rpcRid=0x%"
PRIx64
" connect obj is NULL. req is response and done."
,
rpcRid
);
if
(
pReqOver
)
*
pReqOver
=
true
;
ret
=
true
;
ret
=
true
;
goto
_END
;
goto
_END
;
}
else
if
(
pContext
->
pConn
!=
pContext
->
sendInfo
.
pConn
)
{
}
else
if
(
pContext
->
pConn
!=
pContext
->
sendInfo
.
pConn
)
{
...
@@ -1829,7 +1831,10 @@ bool rpcSendProbe(int64_t rpcRid, void* pPrevContext) {
...
@@ -1829,7 +1831,10 @@ bool rpcSendProbe(int64_t rpcRid, void* pPrevContext) {
}
}
// send syn
// send syn
ret
=
doRpcSendProbe
(
pContext
->
pConn
);
if
(
!
doRpcSendProbe
(
pContext
->
pConn
))
{
tError
(
"PROBE rpcRid=0x%"
PRIx64
" fd=%d rpc send probe data error."
,
rpcRid
,
fd
);
}
ret
=
true
;
_END:
_END:
// put back req context
// put back req context
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录