Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
79b0d1fc
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看板
提交
79b0d1fc
编写于
9月 15, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix memory leak.
上级
18924f9a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
8 deletion
+15
-8
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+2
-1
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+13
-7
未找到文件。
source/libs/executor/src/executor.c
浏览文件 @
79b0d1fc
...
@@ -480,6 +480,7 @@ int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds) {
...
@@ -480,6 +480,7 @@ int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds) {
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
pTaskInfo
->
code
=
ret
;
pTaskInfo
->
code
=
ret
;
cleanUpUdfs
();
cleanUpUdfs
();
qDebug
(
"%s task abort due to error/cancel occurs, code:%s"
,
GET_TASKID
(
pTaskInfo
),
tstrerror
(
pTaskInfo
->
code
));
qDebug
(
"%s task abort due to error/cancel occurs, code:%s"
,
GET_TASKID
(
pTaskInfo
),
tstrerror
(
pTaskInfo
->
code
));
atomic_store_64
(
&
pTaskInfo
->
owner
,
0
);
atomic_store_64
(
&
pTaskInfo
->
owner
,
0
);
...
@@ -512,8 +513,8 @@ int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds) {
...
@@ -512,8 +513,8 @@ int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds) {
}
}
cleanUpUdfs
();
cleanUpUdfs
();
uint64_t
total
=
pTaskInfo
->
pRoot
->
resultInfo
.
totalRows
;
uint64_t
total
=
pTaskInfo
->
pRoot
->
resultInfo
.
totalRows
;
qDebug
(
"%s task suspended, %d rows in %d blocks returned, total:%"
PRId64
" rows, in sinkNode:%d, elapsed:%.2f ms"
,
qDebug
(
"%s task suspended, %d rows in %d blocks returned, total:%"
PRId64
" rows, in sinkNode:%d, elapsed:%.2f ms"
,
GET_TASKID
(
pTaskInfo
),
current
,
(
int32_t
)
taosArrayGetSize
(
pResList
),
total
,
0
,
el
/
1000
.
0
);
GET_TASKID
(
pTaskInfo
),
current
,
(
int32_t
)
taosArrayGetSize
(
pResList
),
total
,
0
,
el
/
1000
.
0
);
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
79b0d1fc
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#include "tcommon.h"
#include "tcommon.h"
#include "tmsg.h"
#include "tmsg.h"
#include "tname.h"
#include "tname.h"
#include "tdatablock.h"
SQWorkerMgmt
gQwMgmt
=
{
SQWorkerMgmt
gQwMgmt
=
{
.
lock
=
0
,
.
lock
=
0
,
...
@@ -16,6 +17,11 @@ SQWorkerMgmt gQwMgmt = {
...
@@ -16,6 +17,11 @@ SQWorkerMgmt gQwMgmt = {
.
qwNum
=
0
,
.
qwNum
=
0
,
};
};
static
void
freeBlock
(
void
*
param
)
{
SSDataBlock
*
pBlock
=
*
(
SSDataBlock
**
)
param
;
blockDataDestroy
(
pBlock
);
}
int32_t
qwProcessHbLinkBroken
(
SQWorker
*
mgmt
,
SQWMsg
*
qwMsg
,
SSchedulerHbReq
*
req
)
{
int32_t
qwProcessHbLinkBroken
(
SQWorker
*
mgmt
,
SQWMsg
*
qwMsg
,
SSchedulerHbReq
*
req
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
SSchedulerHbRsp
rsp
=
{
0
};
SSchedulerHbRsp
rsp
=
{
0
};
...
@@ -71,7 +77,7 @@ int32_t qwHandleTaskComplete(QW_FPARAMS_DEF, SQWTaskCtx *ctx) {
...
@@ -71,7 +77,7 @@ int32_t qwHandleTaskComplete(QW_FPARAMS_DEF, SQWTaskCtx *ctx) {
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
\
int32_t
qwExecTask
(
QW_FPARAMS_DEF
,
SQWTaskCtx
*
ctx
,
bool
*
queryStop
)
{
int32_t
qwExecTask
(
QW_FPARAMS_DEF
,
SQWTaskCtx
*
ctx
,
bool
*
queryStop
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
bool
qcontinue
=
true
;
bool
qcontinue
=
true
;
...
@@ -88,6 +94,7 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) {
...
@@ -88,6 +94,7 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) {
// if *taskHandle is NULL, it's killed right now
// if *taskHandle is NULL, it's killed right now
if
(
taskHandle
)
{
if
(
taskHandle
)
{
qwDbgSimulateSleep
();
qwDbgSimulateSleep
();
code
=
qExecTaskOpt
(
taskHandle
,
pResList
,
&
useconds
);
code
=
qExecTaskOpt
(
taskHandle
,
pResList
,
&
useconds
);
if
(
code
)
{
if
(
code
)
{
if
(
code
!=
TSDB_CODE_OPS_NOT_SUPPORT
)
{
if
(
code
!=
TSDB_CODE_OPS_NOT_SUPPORT
)
{
...
@@ -150,8 +157,7 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) {
...
@@ -150,8 +157,7 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) {
}
}
_return:
_return:
taosArrayDestroyEx
(
pResList
,
freeBlock
);
taosArrayDestroy
(
pResList
);
QW_RET
(
code
);
QW_RET
(
code
);
}
}
...
@@ -915,13 +921,13 @@ void qwProcessHbTimerEvent(void *param, void *tmrId) {
...
@@ -915,13 +921,13 @@ void qwProcessHbTimerEvent(void *param, void *tmrId) {
void
*
pIter
=
taosHashIterate
(
mgmt
->
schHash
,
NULL
);
void
*
pIter
=
taosHashIterate
(
mgmt
->
schHash
,
NULL
);
while
(
pIter
)
{
while
(
pIter
)
{
SQWSchStatus
*
sch
=
(
SQWSchStatus
*
)
pIter
;
SQWSchStatus
*
sch
1
=
(
SQWSchStatus
*
)
pIter
;
if
(
NULL
==
sch
->
hbConnInfo
.
handle
)
{
if
(
NULL
==
sch
1
->
hbConnInfo
.
handle
)
{
uint64_t
*
sId
=
taosHashGetKey
(
pIter
,
NULL
);
uint64_t
*
sId
=
taosHashGetKey
(
pIter
,
NULL
);
QW_TLOG
(
"cancel send hb to sch %"
PRIx64
" cause of no connection handle"
,
*
sId
);
QW_TLOG
(
"cancel send hb to sch %"
PRIx64
" cause of no connection handle"
,
*
sId
);
if
(
sch
->
hbBrokenTs
>
0
&&
((
currentMs
-
sch
->
hbBrokenTs
)
>
QW_SCH_TIMEOUT_MSEC
)
&&
if
(
sch
1
->
hbBrokenTs
>
0
&&
((
currentMs
-
sch1
->
hbBrokenTs
)
>
QW_SCH_TIMEOUT_MSEC
)
&&
taosHashGetSize
(
sch
->
tasksHash
)
<=
0
)
{
taosHashGetSize
(
sch
1
->
tasksHash
)
<=
0
)
{
taosArrayPush
(
pExpiredSch
,
sId
);
taosArrayPush
(
pExpiredSch
,
sId
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录