Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
fa482840
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看板
提交
fa482840
编写于
6月 22, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: handle except
上级
772c04f3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
13 deletion
+10
-13
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+10
-13
未找到文件。
source/libs/transport/src/transCli.c
浏览文件 @
fa482840
...
...
@@ -175,7 +175,7 @@ static void cliReleaseUnfinishedMsg(SCliConn* conn) {
#define CONN_SHOULD_RELEASE(conn, head) \
do { \
if ((head)->release == 1 && (head->msgLen) == sizeof(*head)) { \
int
connStatus = conn->status;
\
int
connStatus = conn->status;
\
uint64_t ahandle = head->ahandle; \
CONN_GET_MSGCTX_BY_AHANDLE(conn, ahandle); \
conn->status = ConnRelease; \
...
...
@@ -188,8 +188,8 @@ static void cliReleaseUnfinishedMsg(SCliConn* conn) {
destroyCmsg(pMsg); \
cliReleaseUnfinishedMsg(conn); \
if (connStatus != ConnInPool) { \
addConnToPool(((SCliThrdObj*)conn->hostThrd)->pool, conn);
\
} \
addConnToPool(((SCliThrdObj*)conn->hostThrd)->pool, conn);
\
}
\
return; \
} \
} while (0)
...
...
@@ -453,7 +453,7 @@ void* destroyConnPool(void* pool) {
while
(
connList
!=
NULL
)
{
while
(
!
QUEUE_IS_EMPTY
(
&
connList
->
conn
))
{
queue
*
h
=
QUEUE_HEAD
(
&
connList
->
conn
);
//QUEUE_REMOVE(h);
//
QUEUE_REMOVE(h);
SCliConn
*
c
=
QUEUE_DATA
(
h
,
SCliConn
,
conn
);
cliDestroyConn
(
c
,
true
);
}
...
...
@@ -466,7 +466,7 @@ void* destroyConnPool(void* pool) {
static
SCliConn
*
getConnFromPool
(
void
*
pool
,
char
*
ip
,
uint32_t
port
)
{
char
key
[
128
]
=
{
0
};
CONN_CONSTRUCT_HASH_KEY
(
key
,
ip
,
port
);
SHashObj
*
pPool
=
pool
;
SConnList
*
plist
=
taosHashGet
(
pPool
,
key
,
strlen
(
key
));
if
(
plist
==
NULL
)
{
...
...
@@ -480,14 +480,12 @@ static SCliConn* getConnFromPool(void* pool, char* ip, uint32_t port) {
return
NULL
;
}
queue
*
h
=
QUEUE_HEAD
(
&
plist
->
conn
);
//QUEUE_REMOVE(h);
queue
*
h
=
QUEUE_HEAD
(
&
plist
->
conn
);
SCliConn
*
conn
=
QUEUE_DATA
(
h
,
SCliConn
,
conn
);
conn
->
status
=
ConnNormal
;
QUEUE_REMOVE
(
&
conn
->
conn
);
tTrace
(
"conn %p conn key: %s: "
,
conn
,
key
);
QUEUE_INIT
(
&
conn
->
conn
);
assert
(
h
==
&
conn
->
conn
);
//QUEUE_INIT(&conn->conn);
return
conn
;
}
static
void
addConnToPool
(
void
*
pool
,
SCliConn
*
conn
)
{
...
...
@@ -507,8 +505,7 @@ static void addConnToPool(void* pool, SCliConn* conn) {
SConnList
*
plist
=
taosHashGet
((
SHashObj
*
)
pool
,
key
,
strlen
(
key
));
// list already create before
assert
(
plist
!=
NULL
);
tTrace
(
"conn %p conn key: %s: "
,
conn
,
key
);
//QUEUE_INIT(&conn->conn);
// QUEUE_INIT(&conn->conn);
QUEUE_PUSH
(
&
plist
->
conn
,
&
conn
->
conn
);
assert
(
!
QUEUE_IS_EMPTY
(
&
plist
->
conn
));
}
...
...
@@ -571,7 +568,7 @@ static SCliConn* cliCreateConn(SCliThrdObj* pThrd) {
static
void
cliDestroyConn
(
SCliConn
*
conn
,
bool
clear
)
{
tTrace
(
"%s conn %p remove from conn pool"
,
CONN_GET_INST_LABEL
(
conn
),
conn
);
QUEUE_REMOVE
(
&
conn
->
conn
);
//QUEUE_INIT(&conn->conn);
//
QUEUE_INIT(&conn->conn);
if
(
clear
)
{
uv_close
((
uv_handle_t
*
)
conn
->
stream
,
cliDestroy
);
}
...
...
@@ -1016,7 +1013,7 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
pCtx
->
retryCount
+
1
,
TRANS_RETRY_COUNT_LIMIT
);
}
if
(
pConn
->
status
!=
ConnInPool
)
{
addConnToPool
(
pThrd
->
pool
,
pConn
);
addConnToPool
(
pThrd
->
pool
,
pConn
);
}
STaskArg
*
arg
=
taosMemoryMalloc
(
sizeof
(
STaskArg
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录