Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
87a15d45
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,发现更多精彩内容 >>
提交
87a15d45
编写于
7月 22, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rm idle conn
上级
607c042a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
27 deletion
+31
-27
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+3
-2
source/libs/transport/src/transSvr.c
source/libs/transport/src/transSvr.c
+28
-25
未找到文件。
source/libs/transport/src/transCli.c
浏览文件 @
87a15d45
...
@@ -187,7 +187,7 @@ static void cliReleaseUnfinishedMsg(SCliConn* conn) {
...
@@ -187,7 +187,7 @@ static void cliReleaseUnfinishedMsg(SCliConn* conn) {
pThrd = (SCliThrd*)(exh)->pThrd; \
pThrd = (SCliThrd*)(exh)->pThrd; \
} \
} \
} while (0)
} while (0)
#define CONN_PERSIST_TIME(para) (
para * 20
)
#define CONN_PERSIST_TIME(para) (
(para) == 0 ? 3 * 1000 : 10 * (para)
)
#define CONN_GET_HOST_THREAD(conn) (conn ? ((SCliConn*)conn)->hostThrd : NULL)
#define CONN_GET_HOST_THREAD(conn) (conn ? ((SCliConn*)conn)->hostThrd : NULL)
#define CONN_GET_INST_LABEL(conn) (((STrans*)(((SCliThrd*)(conn)->hostThrd)->pTransInst))->label)
#define CONN_GET_INST_LABEL(conn) (((STrans*)(((SCliThrd*)(conn)->hostThrd)->pTransInst))->label)
#define CONN_SHOULD_RELEASE(conn, head) \
#define CONN_SHOULD_RELEASE(conn, head) \
...
@@ -1078,7 +1078,8 @@ static void doCloseIdleConn(void* param) {
...
@@ -1078,7 +1078,8 @@ static void doCloseIdleConn(void* param) {
STaskArg
*
arg
=
param
;
STaskArg
*
arg
=
param
;
SCliConn
*
conn
=
arg
->
param1
;
SCliConn
*
conn
=
arg
->
param1
;
SCliThrd
*
pThrd
=
arg
->
param2
;
SCliThrd
*
pThrd
=
arg
->
param2
;
tTrace
(
"%s conn %p idle, close it"
,
CONN_GET_INST_LABEL
(
conn
),
conn
);
conn
->
task
=
NULL
;
cliDestroyConn
(
conn
,
true
);
cliDestroyConn
(
conn
,
true
);
taosMemoryFree
(
arg
);
taosMemoryFree
(
arg
);
}
}
...
...
source/libs/transport/src/transSvr.c
浏览文件 @
87a15d45
...
@@ -149,31 +149,34 @@ static void* transAcceptThread(void* arg);
...
@@ -149,31 +149,34 @@ static void* transAcceptThread(void* arg);
static
bool
addHandleToWorkloop
(
SWorkThrd
*
pThrd
,
char
*
pipeName
);
static
bool
addHandleToWorkloop
(
SWorkThrd
*
pThrd
,
char
*
pipeName
);
static
bool
addHandleToAcceptloop
(
void
*
arg
);
static
bool
addHandleToAcceptloop
(
void
*
arg
);
#define CONN_SHOULD_RELEASE(conn, head) \
#define CONN_SHOULD_RELEASE(conn, head) \
do { \
do { \
if ((head)->release == 1 && (head->msgLen) == sizeof(*head)) { \
if ((head)->release == 1 && (head->msgLen) == sizeof(*head)) { \
conn->status = ConnRelease; \
reallocConnRef(conn); \
transClearBuffer(&conn->readBuf); \
tTrace("conn %p received release request", conn); \
transFreeMsg(transContFromHead((char*)head)); \
\
tTrace("conn %p received release request", conn); \
STraceId traceId = head->traceId; \
STransMsg tmsg = {.code = 0, .info.handle = (void*)conn, .info.traceId = head->traceId, .info.ahandle = NULL}; \
conn->status = ConnRelease; \
SSvrMsg* srvMsg = taosMemoryCalloc(1, sizeof(SSvrMsg)); \
transClearBuffer(&conn->readBuf); \
srvMsg->msg = tmsg; \
transFreeMsg(transContFromHead((char*)head)); \
srvMsg->type = Release; \
\
srvMsg->pConn = conn; \
STransMsg tmsg = {.code = 0, .info.handle = (void*)conn, .info.traceId = traceId, .info.ahandle = NULL}; \
reallocConnRef(conn); \
SSvrMsg* srvMsg = taosMemoryCalloc(1, sizeof(SSvrMsg)); \
if (!transQueuePush(&conn->srvMsgs, srvMsg)) { \
srvMsg->msg = tmsg; \
return; \
srvMsg->type = Release; \
} \
srvMsg->pConn = conn; \
if (conn->regArg.init) { \
if (!transQueuePush(&conn->srvMsgs, srvMsg)) { \
tTrace("conn %p release, notify server app", conn); \
return; \
STrans* pTransInst = conn->pTransInst; \
} \
(*pTransInst->cfp)(pTransInst->parent, &(conn->regArg.msg), NULL); \
if (conn->regArg.init) { \
memset(&conn->regArg, 0, sizeof(conn->regArg)); \
tTrace("conn %p release, notify server app", conn); \
} \
STrans* pTransInst = conn->pTransInst; \
uvStartSendRespInternal(srvMsg); \
(*pTransInst->cfp)(pTransInst->parent, &(conn->regArg.msg), NULL); \
return; \
memset(&conn->regArg, 0, sizeof(conn->regArg)); \
} \
} \
uvStartSendRespInternal(srvMsg); \
return; \
} \
} while (0)
} while (0)
#define SRV_RELEASE_UV(loop) \
#define SRV_RELEASE_UV(loop) \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录