Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
d536eb56
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d536eb56
编写于
5月 27, 2020
作者:
S
Steven Li
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/hotfix/freesqlobj' into feature/crash_gen
上级
e3fb8775
82a3dcab
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
18 deletion
+18
-18
src/client/src/tscServer.c
src/client/src/tscServer.c
+5
-3
src/client/src/tscSql.c
src/client/src/tscSql.c
+11
-15
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+2
-0
未找到文件。
src/client/src/tscServer.c
浏览文件 @
d536eb56
...
...
@@ -217,10 +217,12 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
STscObj
*
pObj
=
pSql
->
pTscObj
;
// tscTrace("%p msg:%s is received from server", pSql, taosMsg[rpcMsg->msgType]);
if
(
p
Sql
->
freed
||
p
Obj
->
signature
!=
pObj
)
{
if
(
pObj
->
signature
!=
pObj
)
{
tscTrace
(
"%p sql is already released or DB connection is closed, freed:%d pObj:%p signature:%p"
,
pSql
,
pSql
->
freed
,
pObj
,
pObj
->
signature
);
tscFreeSqlObj
(
pSql
);
if
(
pSql
!=
pObj
->
pSql
)
{
tscFreeSqlObj
(
pSql
);
}
rpcFreeCont
(
rpcMsg
->
pCont
);
return
;
}
...
...
@@ -1867,8 +1869,8 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
return
TSDB_CODE_CLI_OUT_OF_MEMORY
;
}
free
(
pTableMeta
);
tscTrace
(
"%p recv table meta: %"
PRId64
", tid:%d, name:%s"
,
pSql
,
pTableMeta
->
uid
,
pTableMeta
->
sid
,
pTableMetaInfo
->
name
);
free
(
pTableMeta
);
return
TSDB_CODE_SUCCESS
;
}
...
...
src/client/src/tscSql.c
浏览文件 @
d536eb56
...
...
@@ -576,26 +576,22 @@ void taos_free_result_imp(TAOS_RES *res, int keepCmd) {
* for each subquery. Because the failure of execution tsProcessSql may trigger the callback function
* be executed, and the retry efforts may result in double free the resources, e.g.,SRetrieveSupport
*/
if
((
pCmd
->
command
==
TSDB_SQL_SELECT
||
pCmd
->
command
==
TSDB_SQL_SHOW
||
pCmd
->
command
==
TSDB_SQL_RETRIEVE
||
pCmd
->
command
==
TSDB_SQL_FETCH
)
&&
(
pRes
->
code
!=
TSDB_CODE_QUERY_CANCELLED
&&
((
pRes
->
numOfRows
>
0
&&
pCmd
->
command
<
TSDB_SQL_LOCAL
&&
pRes
->
completed
==
false
)
||
(
pRes
->
code
==
TSDB_CODE_SUCCESS
&&
pRes
->
numOfRows
==
0
&&
pCmd
->
command
==
TSDB_SQL_SELECT
&&
pSql
->
pStream
==
NULL
&&
pTableMetaInfo
->
pTableMeta
!=
NULL
))))
{
if
((
pCmd
->
command
==
TSDB_SQL_SELECT
||
pCmd
->
command
==
TSDB_SQL_SHOW
||
pCmd
->
command
==
TSDB_SQL_RETRIEVE
||
pCmd
->
command
==
TSDB_SQL_FETCH
)
&&
(
pRes
->
code
!=
TSDB_CODE_QUERY_CANCELLED
&&
((
pCmd
->
command
<
TSDB_SQL_LOCAL
&&
pRes
->
completed
==
false
)
||
(
pRes
->
code
==
TSDB_CODE_SUCCESS
&&
pCmd
->
command
==
TSDB_SQL_SELECT
&&
pSql
->
pStream
==
NULL
&&
pTableMetaInfo
->
pTableMeta
!=
NULL
))))
{
pCmd
->
command
=
(
pCmd
->
command
>
TSDB_SQL_MGMT
)
?
TSDB_SQL_RETRIEVE
:
TSDB_SQL_FETCH
;
tscTrace
(
"%p code:%d, numOfRows:%d, command:%d"
,
pSql
,
pRes
->
code
,
pRes
->
numOfRows
,
pCmd
->
command
);
tscTrace
(
"%p send msg to free qhandle in vnode, code:%d, numOfRows:%d, command:%s"
,
pSql
,
pRes
->
code
,
pRes
->
numOfRows
,
sqlCmd
[
pCmd
->
command
]);
pSql
->
freed
=
1
;
tscProcessSql
(
pSql
);
/*
* If release connection msg is sent to vnode, the corresponding SqlObj for async query can not be freed instantly,
* since its free operation is delegated to callback function, which is tscProcessMsgFromServer.
*/
STscObj
*
pObj
=
pSql
->
pTscObj
;
if
(
pObj
->
pSql
==
pSql
)
{
pObj
->
pSql
=
NULL
;
}
// waits for response and then goes on
sem_wait
(
&
pSql
->
rspSem
);
}
else
{
// if no free resource msg is sent to vnode, we free this object immediately.
STscObj
*
pTscObj
=
pSql
->
pTscObj
;
...
...
src/client/src/tscUtil.c
浏览文件 @
d536eb56
...
...
@@ -423,6 +423,8 @@ void tscFreeSqlObj(SSqlObj* pSql) {
tfree
(
pCmd
->
payload
);
pCmd
->
allocSize
=
0
;
tfree
(
pSql
->
sqlstr
);
free
(
pSql
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录