Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ad051d4e
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看板
提交
ad051d4e
编写于
7月 13, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix stop query issue
上级
346c8640
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
26 deletion
+30
-26
source/client/inc/clientInt.h
source/client/inc/clientInt.h
+1
-0
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+2
-1
source/client/src/clientMain.c
source/client/src/clientMain.c
+21
-22
tests/script/api/stopquery.c
tests/script/api/stopquery.c
+6
-3
未找到文件。
source/client/inc/clientInt.h
浏览文件 @
ad051d4e
...
...
@@ -181,6 +181,7 @@ typedef struct SRequestSendRecvBody {
tsem_t
rspSem
;
// not used now
__taos_async_fn_t
queryFp
;
__taos_async_fn_t
fetchFp
;
EQueryExecMode
execMode
;
void
*
param
;
SDataBuf
requestMsg
;
int64_t
queryJob
;
// query job, created according to sql query DAG.
...
...
source/client/src/clientImpl.c
浏览文件 @
ad051d4e
...
...
@@ -933,6 +933,8 @@ SRequestObj* launchQuery(uint64_t connId, const char* sql, int sqlLen, bool vali
void
launchAsyncQuery
(
SRequestObj
*
pRequest
,
SQuery
*
pQuery
,
SMetaData
*
pResultMeta
)
{
int32_t
code
=
0
;
pRequest
->
body
.
execMode
=
pQuery
->
execMode
;
switch
(
pQuery
->
execMode
)
{
case
QUERY_EXEC_MODE_LOCAL
:
asyncExecLocalCmd
(
pRequest
,
pQuery
);
...
...
@@ -1149,7 +1151,6 @@ STscObj* taosConnectImpl(const char* user, const char* auth, const char* db, __t
SRequestObj
*
pRequest
=
createRequest
(
pTscObj
->
id
,
TDMT_MND_CONNECT
);
if
(
pRequest
==
NULL
)
{
destroyTscObj
(
pTscObj
);
terrno
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
return
NULL
;
}
...
...
source/client/src/clientMain.c
浏览文件 @
ad051d4e
...
...
@@ -49,7 +49,7 @@ int taos_options(TSDB_OPTION option, const void *arg, ...) {
}
// this function may be called by user or system, or by both simultaneously.
void
taos_cleanup
(
void
)
{
tsc
Info
(
"start
to cleanup client environment"
);
tsc
Debug
(
"start
to cleanup client environment"
);
if
(
atomic_val_compare_exchange_32
(
&
sentinel
,
TSC_VAR_NOT_RELEASE
,
TSC_VAR_RELEASED
)
!=
TSC_VAR_NOT_RELEASE
)
{
return
;
}
...
...
@@ -58,7 +58,10 @@ void taos_cleanup(void) {
clientReqRefPool
=
-
1
;
taosCloseRef
(
id
);
cleanupTaskQueue
();
hbMgrCleanUp
();
catalogDestroy
();
schedulerDestroy
();
fmFuncMgtDestroy
();
qCleanupKeywordsTable
();
...
...
@@ -67,12 +70,11 @@ void taos_cleanup(void) {
clientConnRefPool
=
-
1
;
taosCloseRef
(
id
);
hbMgrCleanUp
();
rpcCleanup
();
tscDebug
(
"rpc cleanup"
);
catalogDestroy
();
schedulerDestroy
();
cleanupTaskQueue
();
rpcCleanup
();
tscInfo
(
"all local resources released"
);
taosCleanupCfg
();
taosCloseLog
();
...
...
@@ -852,27 +854,24 @@ void taos_fetch_rows_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) {
}
// all data has returned to App already, no need to try again
if
(
pResultInfo
->
completed
&&
(
pRequest
->
body
.
queryJob
!=
0
))
{
pResultInfo
->
numOfRows
=
0
;
pRequest
->
body
.
fetchFp
(
param
,
pRequest
,
pResultInfo
->
numOfRows
);
return
;
}
// it is a local executed query, no need to do async fetch
if
(
pRequest
->
body
.
queryJob
==
0
)
{
ASSERT
(
pResultInfo
->
completed
&&
pResultInfo
->
numOfRows
>=
0
);
if
(
pResultInfo
->
localResultFetched
)
{
pResultInfo
->
numOfRows
=
0
;
pResultInfo
->
current
=
0
;
pRequest
->
body
.
fetchFp
(
param
,
pRequest
,
pResultInfo
->
numOfRows
);
if
(
pResultInfo
->
completed
)
{
// it is a local executed query, no need to do async fetch
if
(
QUERY_EXEC_MODE_LOCAL
==
pRequest
->
body
.
execMode
)
{
ASSERT
(
pResultInfo
->
numOfRows
>=
0
);
if
(
pResultInfo
->
localResultFetched
)
{
pResultInfo
->
numOfRows
=
0
;
pResultInfo
->
current
=
0
;
}
else
{
pResultInfo
->
localResultFetched
=
true
;
}
}
else
{
pResultInfo
->
localResultFetched
=
true
;
pRequest
->
body
.
fetchFp
(
param
,
pRequest
,
pResultInfo
->
numOfRows
);
pResultInfo
->
numOfRows
=
0
;
}
pRequest
->
body
.
fetchFp
(
param
,
pRequest
,
pResultInfo
->
numOfRows
);
return
;
}
SSchedulerReq
req
=
{
.
syncReq
=
false
,
.
fetchFp
=
fetchCallback
,
...
...
tests/script/api/stopquery.c
浏览文件 @
ad051d4e
...
...
@@ -633,6 +633,7 @@ int sqConCleanupSyncQuery(bool fetch) {
pthread_join
(
qid
,
NULL
);
pthread_join
(
cid
,
NULL
);
break
;
}
CASE_LEAVE
();
}
...
...
@@ -648,6 +649,7 @@ int sqConCleanupAsyncQuery(bool fetch) {
pthread_join
(
qid
,
NULL
);
pthread_join
(
cid
,
NULL
);
break
;
}
CASE_LEAVE
();
}
...
...
@@ -655,7 +657,7 @@ int sqConCleanupAsyncQuery(bool fetch) {
void
sqRunAllCase
(
void
)
{
#if
0
#if
1
sqStopSyncQuery
(
false
);
sqStopSyncQuery
(
true
);
sqStopAsyncQuery
(
false
);
...
...
@@ -688,16 +690,17 @@ void sqRunAllCase(void) {
sqConKillAsyncQuery
(
true
);
#endif
/*
sqConCleanupSyncQuery(false);
sqConCleanupSyncQuery(true);
sqConCleanupAsyncQuery(false);
sqConCleanupAsyncQuery(true);
*/
int32_t
l
=
5
;
while
(
l
)
{
printf
(
"%d
\n
"
,
l
--
);
sleep
(
1
000
);
sleep
(
1
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录