Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
82051684
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看板
提交
82051684
编写于
4月 28, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix memory leak.
上级
7adc2102
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
7 addition
and
9 deletion
+7
-9
source/libs/executor/inc/querytask.h
source/libs/executor/inc/querytask.h
+1
-1
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+1
-1
source/libs/executor/src/querytask.c
source/libs/executor/src/querytask.c
+5
-7
未找到文件。
source/libs/executor/inc/querytask.h
浏览文件 @
82051684
...
@@ -67,7 +67,7 @@ struct SExecTaskInfo {
...
@@ -67,7 +67,7 @@ struct SExecTaskInfo {
};
};
void
buildTaskId
(
uint64_t
taskId
,
uint64_t
queryId
,
char
*
dst
);
void
buildTaskId
(
uint64_t
taskId
,
uint64_t
queryId
,
char
*
dst
);
SExecTaskInfo
*
doCreateTask
(
uint64_t
queryId
,
uint64_t
taskId
,
int32_t
vgId
,
EOPTR_EXEC_MODEL
model
,
char
*
dbFName
);
SExecTaskInfo
*
doCreateTask
(
uint64_t
queryId
,
uint64_t
taskId
,
int32_t
vgId
,
EOPTR_EXEC_MODEL
model
);
void
doDestroyTask
(
SExecTaskInfo
*
pTaskInfo
);
void
doDestroyTask
(
SExecTaskInfo
*
pTaskInfo
);
bool
isTaskKilled
(
SExecTaskInfo
*
pTaskInfo
);
bool
isTaskKilled
(
SExecTaskInfo
*
pTaskInfo
);
void
setTaskKilled
(
SExecTaskInfo
*
pTaskInfo
,
int32_t
rspCode
);
void
setTaskKilled
(
SExecTaskInfo
*
pTaskInfo
,
int32_t
rspCode
);
...
...
source/libs/executor/src/executor.c
浏览文件 @
82051684
...
@@ -250,7 +250,7 @@ int32_t qSetSMAInput(qTaskInfo_t tinfo, const void* pBlocks, size_t numOfBlocks,
...
@@ -250,7 +250,7 @@ int32_t qSetSMAInput(qTaskInfo_t tinfo, const void* pBlocks, size_t numOfBlocks,
qTaskInfo_t
qCreateQueueExecTaskInfo
(
void
*
msg
,
SReadHandle
*
pReaderHandle
,
int32_t
vgId
,
int32_t
*
numOfCols
,
qTaskInfo_t
qCreateQueueExecTaskInfo
(
void
*
msg
,
SReadHandle
*
pReaderHandle
,
int32_t
vgId
,
int32_t
*
numOfCols
,
uint64_t
id
)
{
uint64_t
id
)
{
if
(
msg
==
NULL
)
{
// create raw scan
if
(
msg
==
NULL
)
{
// create raw scan
SExecTaskInfo
*
pTaskInfo
=
doCreateTask
(
0
,
id
,
vgId
,
OPTR_EXEC_MODEL_QUEUE
,
""
);
SExecTaskInfo
*
pTaskInfo
=
doCreateTask
(
0
,
id
,
vgId
,
OPTR_EXEC_MODEL_QUEUE
);
if
(
NULL
==
pTaskInfo
)
{
if
(
NULL
==
pTaskInfo
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
NULL
;
return
NULL
;
...
...
source/libs/executor/src/querytask.c
浏览文件 @
82051684
...
@@ -35,8 +35,7 @@
...
@@ -35,8 +35,7 @@
#define CLEAR_QUERY_STATUS(q, st) ((q)->status &= (~(st)))
#define CLEAR_QUERY_STATUS(q, st) ((q)->status &= (~(st)))
SExecTaskInfo
*
doCreateTask
(
uint64_t
queryId
,
uint64_t
taskId
,
int32_t
vgId
,
EOPTR_EXEC_MODEL
model
,
SExecTaskInfo
*
doCreateTask
(
uint64_t
queryId
,
uint64_t
taskId
,
int32_t
vgId
,
EOPTR_EXEC_MODEL
model
)
{
char
*
dbFName
)
{
SExecTaskInfo
*
pTaskInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SExecTaskInfo
));
SExecTaskInfo
*
pTaskInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SExecTaskInfo
));
if
(
pTaskInfo
==
NULL
)
{
if
(
pTaskInfo
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
...
@@ -46,17 +45,17 @@ SExecTaskInfo* doCreateTask(uint64_t queryId, uint64_t taskId, int32_t vgId, EOP
...
@@ -46,17 +45,17 @@ SExecTaskInfo* doCreateTask(uint64_t queryId, uint64_t taskId, int32_t vgId, EOP
setTaskStatus
(
pTaskInfo
,
TASK_NOT_COMPLETED
);
setTaskStatus
(
pTaskInfo
,
TASK_NOT_COMPLETED
);
pTaskInfo
->
cost
.
created
=
taosGetTimestampUs
();
pTaskInfo
->
cost
.
created
=
taosGetTimestampUs
();
pTaskInfo
->
schemaInfo
.
dbname
=
taosStrdup
(
dbFName
);
pTaskInfo
->
execModel
=
model
;
pTaskInfo
->
execModel
=
model
;
pTaskInfo
->
stopInfo
.
pStopInfo
=
taosArrayInit
(
4
,
sizeof
(
SExchangeOpStopInfo
));
pTaskInfo
->
stopInfo
.
pStopInfo
=
taosArrayInit
(
4
,
sizeof
(
SExchangeOpStopInfo
));
pTaskInfo
->
pResultBlockList
=
taosArrayInit
(
128
,
POINTER_BYTES
);
pTaskInfo
->
pResultBlockList
=
taosArrayInit
(
128
,
POINTER_BYTES
);
taosInitRWLatch
(
&
pTaskInfo
->
lock
);
taosInitRWLatch
(
&
pTaskInfo
->
lock
);
pTaskInfo
->
id
.
vgId
=
vgId
;
pTaskInfo
->
id
.
vgId
=
vgId
;
pTaskInfo
->
id
.
queryId
=
queryId
;
pTaskInfo
->
id
.
queryId
=
queryId
;
pTaskInfo
->
id
.
str
=
taosMemoryMalloc
(
64
);
pTaskInfo
->
id
.
str
=
taosMemoryMalloc
(
64
);
buildTaskId
(
taskId
,
queryId
,
pTaskInfo
->
id
.
str
);
buildTaskId
(
taskId
,
queryId
,
pTaskInfo
->
id
.
str
);
return
pTaskInfo
;
return
pTaskInfo
;
}
}
...
@@ -79,7 +78,7 @@ void setTaskStatus(SExecTaskInfo* pTaskInfo, int8_t status) {
...
@@ -79,7 +78,7 @@ void setTaskStatus(SExecTaskInfo* pTaskInfo, int8_t status) {
int32_t
createExecTaskInfo
(
SSubplan
*
pPlan
,
SExecTaskInfo
**
pTaskInfo
,
SReadHandle
*
pHandle
,
uint64_t
taskId
,
int32_t
createExecTaskInfo
(
SSubplan
*
pPlan
,
SExecTaskInfo
**
pTaskInfo
,
SReadHandle
*
pHandle
,
uint64_t
taskId
,
int32_t
vgId
,
char
*
sql
,
EOPTR_EXEC_MODEL
model
)
{
int32_t
vgId
,
char
*
sql
,
EOPTR_EXEC_MODEL
model
)
{
*
pTaskInfo
=
doCreateTask
(
pPlan
->
id
.
queryId
,
taskId
,
vgId
,
model
,
pPlan
->
dbFName
);
*
pTaskInfo
=
doCreateTask
(
pPlan
->
id
.
queryId
,
taskId
,
vgId
,
model
);
if
(
*
pTaskInfo
==
NULL
)
{
if
(
*
pTaskInfo
==
NULL
)
{
goto
_complete
;
goto
_complete
;
}
}
...
@@ -90,8 +89,7 @@ int32_t createExecTaskInfo(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SReadHand
...
@@ -90,8 +89,7 @@ int32_t createExecTaskInfo(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SReadHand
}
}
}
}
(
*
pTaskInfo
)
->
sql
=
sql
;
TSWAP
((
*
pTaskInfo
)
->
sql
,
sql
);
sql
=
NULL
;
(
*
pTaskInfo
)
->
pSubplan
=
pPlan
;
(
*
pTaskInfo
)
->
pSubplan
=
pPlan
;
(
*
pTaskInfo
)
->
pRoot
=
createOperator
(
pPlan
->
pNode
,
*
pTaskInfo
,
pHandle
,
pPlan
->
pTagCond
,
pPlan
->
pTagIndexCond
,
(
*
pTaskInfo
)
->
pRoot
=
createOperator
(
pPlan
->
pNode
,
*
pTaskInfo
,
pHandle
,
pPlan
->
pTagCond
,
pPlan
->
pTagIndexCond
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录