Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Rattenking
TDengine
提交
fee4bde5
T
TDengine
项目概览
Rattenking
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
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,发现更多精彩内容 >>
提交
fee4bde5
编写于
4月 04, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-3350]<fix>: Remove the illegal abort operation in case of multithread environment for sim.
上级
ecfe8eca
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
29 addition
and
3 deletion
+29
-3
tests/tsim/inc/sim.h
tests/tsim/inc/sim.h
+1
-0
tests/tsim/src/simExe.c
tests/tsim/src/simExe.c
+10
-1
tests/tsim/src/simMain.c
tests/tsim/src/simMain.c
+9
-1
tests/tsim/src/simSystem.c
tests/tsim/src/simSystem.c
+9
-1
未找到文件。
tests/tsim/inc/sim.h
浏览文件 @
fee4bde5
...
...
@@ -149,6 +149,7 @@ extern int32_t simScriptSucced;
extern
int32_t
simDebugFlag
;
extern
char
tsScriptDir
[];
extern
bool
simAsyncQuery
;
extern
bool
abortExecution
;
SScript
*
simParseScript
(
char
*
fileName
);
SScript
*
simProcessCallOver
(
SScript
*
script
);
...
...
tests/tsim/src/simExe.c
浏览文件 @
fee4bde5
...
...
@@ -645,8 +645,12 @@ bool simCreateRestFulConnect(SScript *script, char *user, char *pass) {
bool
simCreateNativeConnect
(
SScript
*
script
,
char
*
user
,
char
*
pass
)
{
simCloseTaosdConnect
(
script
);
void
*
taos
=
NULL
;
taosMsleep
(
2000
);
for
(
int32_t
attempt
=
0
;
attempt
<
10
;
++
attempt
)
{
if
(
abortExecution
)
{
script
->
killed
=
true
;
return
false
;
}
taos
=
taos_connect
(
NULL
,
user
,
pass
,
NULL
,
tsDnodeShellPort
);
if
(
taos
==
NULL
)
{
simDebug
(
"script:%s, user:%s connect taosd failed:%s, attempt:%d"
,
script
->
fileName
,
user
,
taos_errstr
(
NULL
),
...
...
@@ -697,6 +701,11 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) {
TAOS_RES
*
pSql
=
NULL
;
for
(
int32_t
attempt
=
0
;
attempt
<
10
;
++
attempt
)
{
if
(
abortExecution
)
{
script
->
killed
=
true
;
return
false
;
}
simLogSql
(
rest
,
false
);
pSql
=
taos_query
(
script
->
taos
,
rest
);
ret
=
taos_errno
(
pSql
);
...
...
tests/tsim/src/simMain.c
浏览文件 @
fee4bde5
...
...
@@ -21,10 +21,13 @@
bool
simAsyncQuery
=
false
;
bool
simExecSuccess
=
false
;
bool
abortExecution
=
false
;
void
simHandleSignal
(
int32_t
signo
,
void
*
sigInfo
,
void
*
context
)
{
simSystemCleanUp
();
exit
(
1
);
abortExecution
=
true
;
// runningScript->killed = true;
// exit(1);
}
int32_t
main
(
int32_t
argc
,
char
*
argv
[])
{
...
...
@@ -60,6 +63,11 @@ int32_t main(int32_t argc, char *argv[]) {
return
-
1
;
}
if
(
abortExecution
)
{
simError
(
"execute abort"
);
return
-
1
;
}
simScriptList
[
++
simScriptPos
]
=
script
;
simExecuteScript
(
script
);
...
...
tests/tsim/src/simSystem.c
浏览文件 @
fee4bde5
...
...
@@ -159,9 +159,17 @@ void *simExecuteScript(void *inputScript) {
script
=
simScriptList
[
simScriptPos
];
}
if
(
abortExecution
)
{
script
->
killed
=
true
;
}
if
(
script
->
killed
||
script
->
linePos
>=
script
->
numOfLines
)
{
printf
(
"killed ---------------------->
\n
"
);
script
=
simProcessCallOver
(
script
);
if
(
script
==
NULL
)
break
;
if
(
script
==
NULL
)
{
printf
(
"abort now!
\n
"
);
break
;
}
}
else
{
SCmdLine
*
line
=
&
script
->
lines
[
script
->
linePos
];
char
*
option
=
script
->
optionBuffer
+
line
->
optionOffset
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录