Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a85a73e2
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看板
提交
a85a73e2
编写于
9月 15, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix memory leak issues
上级
9d148b42
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
17 addition
and
10 deletion
+17
-10
include/libs/executor/executor.h
include/libs/executor/executor.h
+1
-0
source/libs/command/src/explain.c
source/libs/command/src/explain.c
+3
-1
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+8
-7
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+1
-1
source/libs/scheduler/src/schRemote.c
source/libs/scheduler/src/schRemote.c
+2
-0
source/libs/scheduler/src/schTask.c
source/libs/scheduler/src/schTask.c
+2
-1
未找到文件。
include/libs/executor/executor.h
浏览文件 @
a85a73e2
...
...
@@ -33,6 +33,7 @@ typedef int32_t (*localFetchFp)(void *, uint64_t, uint64_t, uint64_t, int64_t, i
typedef
struct
{
void
*
handle
;
bool
localExec
;
localFetchFp
fp
;
SArray
*
explainRes
;
}
SLocalFetch
;
...
...
source/libs/command/src/explain.c
浏览文件 @
a85a73e2
...
...
@@ -28,7 +28,7 @@ void qExplainFreeResNode(SExplainResNode *resNode) {
return
;
}
taos
MemoryFreeClear
(
resNode
->
pExecInfo
);
taos
ArrayDestroy
(
resNode
->
pExecInfo
);
SNode
*
node
=
NULL
;
FOREACH
(
node
,
resNode
->
pChildren
)
{
qExplainFreeResNode
((
SExplainResNode
*
)
node
);
}
...
...
@@ -58,6 +58,7 @@ void qExplainFreeCtx(SExplainCtx *pCtx) {
SExplainRsp
*
rsp
=
taosArrayGet
(
group
->
nodeExecInfo
,
i
);
tFreeSExplainRsp
(
rsp
);
}
taosArrayDestroy
(
group
->
nodeExecInfo
);
}
pIter
=
taosHashIterate
(
pCtx
->
groupHash
,
pIter
);
...
...
@@ -66,6 +67,7 @@ void qExplainFreeCtx(SExplainCtx *pCtx) {
taosHashCleanup
(
pCtx
->
groupHash
);
taosArrayDestroy
(
pCtx
->
rows
);
taosMemoryFreeClear
(
pCtx
->
tbuf
);
taosMemoryFree
(
pCtx
);
}
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
a85a73e2
...
...
@@ -1778,12 +1778,6 @@ void qProcessRspMsg(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
static
int32_t
doSendFetchDataRequest
(
SExchangeInfo
*
pExchangeInfo
,
SExecTaskInfo
*
pTaskInfo
,
int32_t
sourceIndex
)
{
size_t
totalSources
=
taosArrayGetSize
(
pExchangeInfo
->
pSources
);
SResFetchReq
*
pMsg
=
taosMemoryCalloc
(
1
,
sizeof
(
SResFetchReq
));
if
(
NULL
==
pMsg
)
{
pTaskInfo
->
code
=
TSDB_CODE_QRY_OUT_OF_MEMORY
;
return
pTaskInfo
->
code
;
}
SDownstreamSourceNode
*
pSource
=
taosArrayGet
(
pExchangeInfo
->
pSources
,
sourceIndex
);
SSourceDataInfo
*
pDataInfo
=
taosArrayGet
(
pExchangeInfo
->
pSourceDataInfo
,
sourceIndex
);
...
...
@@ -1797,7 +1791,14 @@ static int32_t doSendFetchDataRequest(SExchangeInfo* pExchangeInfo, SExecTaskInf
SDataBuf
pBuf
=
{
0
};
int32_t
code
=
(
*
pTaskInfo
->
localFetch
.
fp
)(
pTaskInfo
->
localFetch
.
handle
,
pSource
->
schedId
,
pTaskInfo
->
id
.
queryId
,
pSource
->
taskId
,
0
,
pSource
->
execId
,
&
pBuf
.
pData
,
pTaskInfo
->
localFetch
.
explainRes
);
loadRemoteDataCallback
(
pWrapper
,
&
pBuf
,
code
);
taosMemoryFree
(
pWrapper
);
}
else
{
SResFetchReq
*
pMsg
=
taosMemoryCalloc
(
1
,
sizeof
(
SResFetchReq
));
if
(
NULL
==
pMsg
)
{
pTaskInfo
->
code
=
TSDB_CODE_QRY_OUT_OF_MEMORY
;
return
pTaskInfo
->
code
;
}
qDebug
(
"%s build fetch msg and send to vgId:%d, ep:%s, taskId:0x%"
PRIx64
", execId:%d, %d/%"
PRIzu
,
GET_TASKID
(
pTaskInfo
),
pSource
->
addr
.
nodeId
,
pSource
->
addr
.
epSet
.
eps
[
0
].
fqdn
,
pSource
->
taskId
,
pSource
->
execId
,
sourceIndex
,
totalSources
);
...
...
@@ -4051,7 +4052,7 @@ void doDestroyTask(SExecTaskInfo* pTaskInfo) {
destroyOperatorInfo
(
pTaskInfo
->
pRoot
);
cleanupTableSchemaInfo
(
&
pTaskInfo
->
schemaInfo
);
if
(
!
pTaskInfo
->
localFetch
.
fp
)
{
if
(
!
pTaskInfo
->
localFetch
.
localExec
)
{
nodesDestroyNode
((
SNode
*
)
pTaskInfo
->
pSubplan
);
}
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
a85a73e2
...
...
@@ -94,7 +94,7 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) {
int32_t
execNum
=
0
;
qTaskInfo_t
taskHandle
=
ctx
->
taskHandle
;
DataSinkHandle
sinkHandle
=
ctx
->
sinkHandle
;
SLocalFetch
localFetch
=
{(
void
*
)
mgmt
,
qWorkerProcessLocalFetch
,
ctx
->
explainRes
};
SLocalFetch
localFetch
=
{(
void
*
)
mgmt
,
ctx
->
localExec
,
qWorkerProcessLocalFetch
,
ctx
->
explainRes
};
SArray
*
pResList
=
taosArrayInit
(
4
,
POINTER_BYTES
);
while
(
true
)
{
...
...
source/libs/scheduler/src/schRemote.c
浏览文件 @
a85a73e2
...
...
@@ -371,6 +371,8 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa
}
SCH_ERR_JRET
(
schProcessExplainRsp
(
pJob
,
pTask
,
&
rsp
));
taosMemoryFreeClear
(
msg
);
break
;
}
case
TDMT_SCH_FETCH_RSP
:
...
...
source/libs/scheduler/src/schTask.c
浏览文件 @
a85a73e2
...
...
@@ -898,7 +898,8 @@ int32_t schLaunchRemoteTask(SSchJob *pJob, SSchTask *pTask) {
pTask
->
msgLen
);
SCH_ERR_RET
(
code
);
}
else
{
SCH_TASK_DLOGL
(
"physical plan len:%d, %s"
,
pTask
->
msgLen
,
pTask
->
msg
);
//binary msg
//SCH_TASK_DLOGL("physical plan len:%d, %s", pTask->msgLen, pTask->msg);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录