Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
09eceed6
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
09eceed6
编写于
7月 01, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix transport quit fix
上级
b2be5169
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
14 addition
and
8 deletion
+14
-8
source/libs/transport/inc/transportInt.h
source/libs/transport/inc/transportInt.h
+1
-1
source/libs/transport/src/trans.c
source/libs/transport/src/trans.c
+6
-2
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+6
-4
source/libs/transport/src/transComm.c
source/libs/transport/src/transComm.c
+1
-1
未找到文件。
source/libs/transport/inc/transportInt.h
浏览文件 @
09eceed6
...
...
@@ -57,7 +57,7 @@ typedef struct {
void
*
parent
;
void
*
tcphandle
;
// returned handle from TCP initialization
int
32_t
refMgt
;
int
64_t
refId
;
TdThreadMutex
mutex
;
}
SRpcInfo
;
...
...
source/libs/transport/src/trans.c
浏览文件 @
09eceed6
...
...
@@ -76,12 +76,16 @@ void* rpcOpen(const SRpcInit* pInit) {
if
(
pInit
->
user
)
{
memcpy
(
pRpc
->
user
,
pInit
->
user
,
strlen
(
pInit
->
user
));
}
int64_t
refId
=
taosAddRef
(
transGetInstMgt
(),
pRpc
);
int64_t
refId
=
transAddExHandle
(
transGetInstMgt
(),
pRpc
);
transAcquireExHandle
(
transGetInstMgt
(),
refId
);
pRpc
->
refId
=
refId
;
return
(
void
*
)
refId
;
}
void
rpcClose
(
void
*
arg
)
{
tInfo
(
"start to close rpc"
);
taosRemoveRef
(
transGetInstMgt
(),
(
int64_t
)
arg
);
transRemoveExHandle
(
transGetInstMgt
(),
(
int64_t
)
arg
);
transReleaseExHandle
(
transGetInstMgt
(),
(
int64_t
)
arg
);
tInfo
(
"finish to close rpc"
);
return
;
}
...
...
source/libs/transport/src/transCli.c
浏览文件 @
09eceed6
...
...
@@ -47,6 +47,7 @@ typedef struct SCliMsg {
queue
q
;
STransMsgType
type
;
int64_t
refId
;
uint64_t
st
;
int
sent
;
//(0: no send, 1: alread sent)
}
SCliMsg
;
...
...
@@ -606,11 +607,9 @@ static void cliDestroyConn(SCliConn* conn, bool clear) {
if
(
clear
)
{
if
(
!
uv_is_closing
((
uv_handle_t
*
)
conn
->
stream
))
{
uv_read_stop
(
conn
->
stream
);
uv_close
((
uv_handle_t
*
)
conn
->
stream
,
cliDestroy
);
}
//} else {
// cliDestroy((uv_handle_t*)conn->stream);
//}
}
}
static
void
cliDestroy
(
uv_handle_t
*
handle
)
{
...
...
@@ -635,7 +634,6 @@ static bool cliHandleNoResp(SCliConn* conn) {
SCliMsg
*
pMsg
=
transQueueGet
(
&
conn
->
cliMsgs
,
0
);
if
(
REQUEST_NO_RESP
(
&
pMsg
->
msg
))
{
transQueuePop
(
&
conn
->
cliMsgs
);
// taosArrayRemove(msgs, 0);
destroyCmsg
(
pMsg
);
res
=
true
;
}
...
...
@@ -979,6 +977,7 @@ void cliSendQuit(SCliThrd* thrd) {
}
void
cliWalkCb
(
uv_handle_t
*
handle
,
void
*
arg
)
{
if
(
!
uv_is_closing
(
handle
))
{
uv_read_stop
((
uv_stream_t
*
)
handle
);
uv_close
(
handle
,
cliDestroy
);
}
}
...
...
@@ -1213,6 +1212,7 @@ void transSendRequest(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STra
cliMsg
->
msg
=
*
pReq
;
cliMsg
->
st
=
taosGetTimestampUs
();
cliMsg
->
type
=
Normal
;
cliMsg
->
refId
=
(
int64_t
)
shandle
;
STraceId
*
trace
=
&
pReq
->
info
.
traceId
;
tGTrace
(
"%s send request at thread:%08"
PRId64
", dst: %s:%d, app:%p"
,
transLabel
(
pTransInst
),
pThrd
->
pid
,
...
...
@@ -1250,6 +1250,7 @@ void transSendRecv(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STransM
cliMsg
->
msg
=
*
pReq
;
cliMsg
->
st
=
taosGetTimestampUs
();
cliMsg
->
type
=
Normal
;
cliMsg
->
refId
=
(
int64_t
)
shandle
;
STraceId
*
trace
=
&
pReq
->
info
.
traceId
;
tGTrace
(
"%s send request at thread:%08"
PRId64
", dst: %s:%d, app:%p"
,
transLabel
(
pTransInst
),
pThrd
->
pid
,
...
...
@@ -1283,6 +1284,7 @@ void transSetDefaultAddr(void* shandle, const char* ip, const char* fqdn) {
SCliMsg
*
cliMsg
=
taosMemoryCalloc
(
1
,
sizeof
(
SCliMsg
));
cliMsg
->
ctx
=
pCtx
;
cliMsg
->
type
=
Update
;
cliMsg
->
refId
=
(
int64_t
)
shandle
;
SCliThrd
*
thrd
=
((
SCliObj
*
)
pTransInst
->
tcphandle
)
->
pThreadObj
[
i
];
tDebug
(
"%s update epset at thread:%08"
PRId64
""
,
pTransInst
->
label
,
thrd
->
pid
);
...
...
source/libs/transport/src/transComm.c
浏览文件 @
09eceed6
...
...
@@ -19,7 +19,7 @@
static
TdThreadOnce
transModuleInit
=
PTHREAD_ONCE_INIT
;
static
int32_t
refMgt
;
int32_t
instMgt
;
static
int32_t
instMgt
;
int
transAuthenticateMsg
(
void
*
pMsg
,
int
msgLen
,
void
*
pAuth
,
void
*
pKey
)
{
T_MD5_CTX
context
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录