Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cdf362b5
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
cdf362b5
编写于
2月 03, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix fd limit crash
上级
b1192d50
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
38 addition
and
7 deletion
+38
-7
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+1
-0
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+20
-3
source/libs/transport/src/transComm.c
source/libs/transport/src/transComm.c
+17
-4
未找到文件。
source/client/src/clientImpl.c
浏览文件 @
cdf362b5
...
...
@@ -1460,6 +1460,7 @@ void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
tscError
(
"failed to sched msg to tsc, tsc ready to quit"
);
rpcFreeCont
(
pMsg
->
pCont
);
taosMemoryFree
(
arg
->
pEpset
);
destroySendMsgInfo
(
pMsg
->
info
.
ahandle
);
taosMemoryFree
(
arg
);
}
}
...
...
source/libs/transport/src/transCli.c
浏览文件 @
cdf362b5
...
...
@@ -1275,7 +1275,11 @@ void* transInitClient(uint32_t ip, uint32_t port, char* label, int numOfThreads,
for
(
int
i
=
0
;
i
<
cli
->
numOfThreads
;
i
++
)
{
SCliThrd
*
pThrd
=
createThrdObj
(
shandle
);
int
err
=
taosThreadCreate
(
&
pThrd
->
thread
,
NULL
,
cliWorkThread
,
(
void
*
)(
pThrd
));
if
(
pThrd
==
NULL
)
{
return
NULL
;
}
int
err
=
taosThreadCreate
(
&
pThrd
->
thread
,
NULL
,
cliWorkThread
,
(
void
*
)(
pThrd
));
if
(
err
==
0
)
{
tDebug
(
"success to create tranport-cli thread:%d"
,
i
);
}
...
...
@@ -1332,9 +1336,22 @@ static SCliThrd* createThrdObj(void* trans) {
taosThreadMutexInit
(
&
pThrd
->
msgMtx
,
NULL
);
pThrd
->
loop
=
(
uv_loop_t
*
)
taosMemoryMalloc
(
sizeof
(
uv_loop_t
));
uv_loop_init
(
pThrd
->
loop
);
int
err
=
uv_loop_init
(
pThrd
->
loop
);
if
(
err
!=
0
)
{
tError
(
"failed to init uv_loop, reason:%s"
,
uv_err_name
(
err
));
taosMemoryFree
(
pThrd
->
loop
);
taosThreadMutexDestroy
(
&
pThrd
->
msgMtx
);
taosMemoryFree
(
pThrd
);
return
NULL
;
}
pThrd
->
asyncPool
=
transAsyncPoolCreate
(
pThrd
->
loop
,
8
,
pThrd
,
cliAsyncCb
);
if
(
pThrd
->
asyncPool
==
NULL
)
{
uv_loop_close
(
pThrd
->
loop
);
taosMemoryFree
(
pThrd
->
loop
);
taosThreadMutexDestroy
(
&
pThrd
->
msgMtx
);
taosMemoryFree
(
pThrd
);
return
NULL
;
}
pThrd
->
prepare
=
taosMemoryCalloc
(
1
,
sizeof
(
uv_prepare_t
));
uv_prepare_init
(
pThrd
->
loop
,
pThrd
->
prepare
);
...
...
source/libs/transport/src/transComm.c
浏览文件 @
cdf362b5
...
...
@@ -214,24 +214,37 @@ SAsyncPool* transAsyncPoolCreate(uv_loop_t* loop, int sz, void* arg, AsyncCB cb)
pool
->
nAsync
=
sz
;
pool
->
asyncs
=
taosMemoryCalloc
(
1
,
sizeof
(
uv_async_t
)
*
pool
->
nAsync
);
for
(
int
i
=
0
;
i
<
pool
->
nAsync
;
i
++
)
{
int
i
=
0
,
err
=
0
;
for
(
i
=
0
;
i
<
pool
->
nAsync
;
i
++
)
{
uv_async_t
*
async
=
&
(
pool
->
asyncs
[
i
]);
SAsyncItem
*
item
=
taosMemoryCalloc
(
1
,
sizeof
(
SAsyncItem
));
item
->
pThrd
=
arg
;
QUEUE_INIT
(
&
item
->
qmsg
);
taosThreadMutexInit
(
&
item
->
mtx
,
NULL
);
uv_async_t
*
async
=
&
(
pool
->
asyncs
[
i
]);
uv_async_init
(
loop
,
async
,
cb
);
async
->
data
=
item
;
err
=
uv_async_init
(
loop
,
async
,
cb
);
if
(
err
!=
0
)
{
tError
(
"failed to init async, reason:%s"
,
uv_err_name
(
err
));
break
;
}
}
if
(
i
!=
pool
->
nAsync
)
{
transAsyncPoolDestroy
(
pool
);
pool
=
NULL
;
}
return
pool
;
}
void
transAsyncPoolDestroy
(
SAsyncPool
*
pool
)
{
for
(
int
i
=
0
;
i
<
pool
->
nAsync
;
i
++
)
{
uv_async_t
*
async
=
&
(
pool
->
asyncs
[
i
]);
SAsyncItem
*
item
=
async
->
data
;
if
(
item
==
NULL
)
continue
;
taosThreadMutexDestroy
(
&
item
->
mtx
);
taosMemoryFree
(
item
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录