Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bf2d8540
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看板
未验证
提交
bf2d8540
编写于
10月 14, 2022
作者:
L
Liu Jicong
提交者:
GitHub
10月 14, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17355 from taosdata/feature/stream
fix(stream): memory leak
上级
ceaf0970
1a113a5a
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
19 addition
and
5 deletion
+19
-5
source/client/src/clientTmq.c
source/client/src/clientTmq.c
+4
-1
source/libs/stream/src/stream.c
source/libs/stream/src/stream.c
+5
-1
source/libs/stream/src/streamMeta.c
source/libs/stream/src/streamMeta.c
+8
-1
source/libs/stream/src/streamState.c
source/libs/stream/src/streamState.c
+1
-1
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+1
-1
未找到文件。
source/client/src/clientTmq.c
浏览文件 @
bf2d8540
...
...
@@ -972,6 +972,8 @@ int32_t tmq_subscribe(tmq_t* tmq, const tmq_list_t* topic_list) {
req
.
topicNames
=
taosArrayInit
(
sz
,
sizeof
(
void
*
));
if
(
req
.
topicNames
==
NULL
)
goto
FAIL
;
tscDebug
(
"call tmq subscribe, consumer: %ld, topic num %d"
,
tmq
->
consumerId
,
sz
);
for
(
int32_t
i
=
0
;
i
<
sz
;
i
++
)
{
char
*
topic
=
taosArrayGetP
(
container
,
i
);
...
...
@@ -1297,7 +1299,8 @@ int32_t tmqAskEpCb(void* param, SDataBuf* pMsg, int32_t code) {
pParam
->
code
=
code
;
if
(
code
!=
0
)
{
tscError
(
"consumer:%"
PRId64
", get topic endpoint error, not ready, wait:%d"
,
tmq
->
consumerId
,
pParam
->
async
);
tscError
(
"consumer:%"
PRId64
", get topic endpoint error, not ready, wait:%d, code %x"
,
tmq
->
consumerId
,
pParam
->
async
,
code
);
goto
END
;
}
...
...
source/libs/stream/src/stream.c
浏览文件 @
bf2d8540
...
...
@@ -67,7 +67,11 @@ void streamSchedByTimer(void* param, void* tmrId) {
atomic_store_8
(
&
pTask
->
triggerStatus
,
TASK_TRIGGER_STATUS__INACTIVE
);
streamTaskInput
(
pTask
,
(
SStreamQueueItem
*
)
trigger
);
if
(
streamTaskInput
(
pTask
,
(
SStreamQueueItem
*
)
trigger
)
<
0
)
{
taosFreeQitem
(
trigger
);
taosTmrReset
(
streamSchedByTimer
,
(
int32_t
)
pTask
->
triggerParam
,
pTask
,
streamEnv
.
timer
,
&
pTask
->
timer
);
return
;
}
streamSchedExec
(
pTask
);
}
...
...
source/libs/stream/src/streamMeta.c
浏览文件 @
bf2d8540
...
...
@@ -28,6 +28,7 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
sprintf
(
streamPath
,
"%s/%s"
,
path
,
"stream"
);
pMeta
->
path
=
strdup
(
streamPath
);
if
(
tdbOpen
(
pMeta
->
path
,
16
*
1024
,
1
,
&
pMeta
->
db
)
<
0
)
{
taosMemoryFree
(
streamPath
);
goto
_err
;
}
...
...
@@ -58,7 +59,7 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
return
pMeta
;
_err:
if
(
pMeta
->
path
)
taosMemoryFree
(
pMeta
->
path
);
taosMemoryFree
(
pMeta
->
path
);
if
(
pMeta
->
pTasks
)
taosHashCleanup
(
pMeta
->
pTasks
);
if
(
pMeta
->
pTaskDb
)
tdbTbClose
(
pMeta
->
pTaskDb
);
if
(
pMeta
->
pCheckpointDb
)
tdbTbClose
(
pMeta
->
pCheckpointDb
);
...
...
@@ -250,6 +251,8 @@ int32_t streamLoadTasks(SStreamMeta* pMeta) {
while
(
tdbTbcNext
(
pCur
,
&
pKey
,
&
kLen
,
&
pVal
,
&
vLen
)
==
0
)
{
SStreamTask
*
pTask
=
taosMemoryCalloc
(
1
,
sizeof
(
SStreamTask
));
if
(
pTask
==
NULL
)
{
tdbFree
(
pKey
);
tdbFree
(
pVal
);
return
-
1
;
}
tDecoderInit
(
&
decoder
,
(
uint8_t
*
)
pVal
,
vLen
);
...
...
@@ -257,10 +260,14 @@ int32_t streamLoadTasks(SStreamMeta* pMeta) {
tDecoderClear
(
&
decoder
);
if
(
pMeta
->
expandFunc
(
pMeta
->
ahandle
,
pTask
)
<
0
)
{
tdbFree
(
pKey
);
tdbFree
(
pVal
);
return
-
1
;
}
if
(
taosHashPut
(
pMeta
->
pTasks
,
&
pTask
->
taskId
,
sizeof
(
int32_t
),
&
pTask
,
sizeof
(
void
*
))
<
0
)
{
tdbFree
(
pKey
);
tdbFree
(
pVal
);
return
-
1
;
}
}
...
...
source/libs/stream/src/streamState.c
浏览文件 @
bf2d8540
...
...
@@ -63,7 +63,7 @@ SStreamState* streamStateOpen(char* path, SStreamTask* pTask, bool specPath, int
sprintf
(
statePath
,
"%s/%d"
,
path
,
pTask
->
taskId
);
}
else
{
memset
(
statePath
,
0
,
300
);
strncpy
(
statePath
,
path
,
300
);
t
strncpy
(
statePath
,
path
,
300
);
}
if
(
tdbOpen
(
statePath
,
szPage
,
pages
,
&
pState
->
db
)
<
0
)
{
goto
_err
;
...
...
tests/system-test/fulltest.sh
浏览文件 @
bf2d8540
...
...
@@ -302,7 +302,7 @@ python3 ./test.py -f 7-tmq/tmqCheckData.py
python3 ./test.py
-f
7-tmq/tmqCheckData1.py
#python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 5
python3 ./test.py
-f
7-tmq/tmqConsumerGroup.py
python3 ./test.py
-f
7-tmq/tmqShow.py
#
python3 ./test.py -f 7-tmq/tmqShow.py
python3 ./test.py
-f
7-tmq/tmqAlterSchema.py
python3 ./test.py
-f
7-tmq/tmqConsFromTsdb.py
python3 ./test.py
-f
7-tmq/tmqConsFromTsdb1.py
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录