Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
0d57114b
T
TDengine
项目概览
慢慢CG
/
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看板
提交
0d57114b
编写于
11月 05, 2020
作者:
S
Steven Li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor refactoring of crash_gen tool, now doing multi-record insertion some times
上级
7688a6eb
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
91 addition
and
76 deletion
+91
-76
tests/pytest/crash_gen/crash_gen_main.py
tests/pytest/crash_gen/crash_gen_main.py
+91
-76
未找到文件。
tests/pytest/crash_gen/crash_gen_main.py
浏览文件 @
0d57114b
...
...
@@ -388,9 +388,9 @@ class ThreadCoordinator:
self
.
_syncAtBarrier
()
# For now just cross the barrier
Progress
.
emit
(
Progress
.
END_THREAD_STEP
)
except
threading
.
BrokenBarrierError
as
err
:
Logging
.
info
(
"Main loop aborted, caused by worker thread time-out"
)
Logging
.
info
(
"Main loop aborted, caused by worker thread
(s)
time-out"
)
self
.
_execStats
.
registerFailure
(
"Aborted due to worker thread timeout"
)
print
(
"
\n\n
Worker Thread time-out detected,
important thread info
:"
)
print
(
"
\n\n
Worker Thread time-out detected,
TAOS related threads are
:"
)
ts
=
ThreadStacks
()
ts
.
print
(
filterInternal
=
True
)
workerTimeout
=
True
...
...
@@ -1242,6 +1242,7 @@ class Task():
0x0B
,
# Unable to establish connection, more details in TD-1648
0x200
,
# invalid SQL, TODO: re-examine with TD-934
0x20F
,
# query terminated, possibly due to vnoding being dropped, see TD-1776
0x213
,
# "Disconnected from service", result of "kill connection ???"
0x217
,
# "db not selected", client side defined error code
# 0x218, # "Table does not exist" client side defined error code
0x360
,
# Table already exists
...
...
@@ -1911,29 +1912,21 @@ class TaskAddData(StateTransitionTask):
def
canBeginFrom
(
cls
,
state
:
AnyState
):
return
state
.
canAddData
()
def
_executeInternal
(
self
,
te
:
TaskExecutor
,
wt
:
WorkerThread
):
# ds = self._dbManager # Quite DANGEROUS here, may result in multi-thread client access
db
=
self
.
_db
dbc
=
wt
.
getDbConn
()
tblSeq
=
list
(
range
(
self
.
LARGE_NUMBER_OF_TABLES
if
gConfig
.
larger_data
else
self
.
SMALL_NUMBER_OF_TABLES
))
random
.
shuffle
(
tblSeq
)
for
i
in
tblSeq
:
if
(
i
in
self
.
activeTable
):
# wow already active
print
(
"x"
,
end
=
""
,
flush
=
True
)
# concurrent insertion
else
:
self
.
activeTable
.
add
(
i
)
# marking it active
sTable
=
db
.
getFixedSuperTable
()
regTableName
=
self
.
getRegTableName
(
i
)
# "db.reg_table_{}".format(i)
def
_addDataInBatch
(
self
,
db
,
dbc
,
regTableName
,
te
:
TaskExecutor
):
numRecords
=
self
.
LARGE_NUMBER_OF_RECORDS
if
gConfig
.
larger_data
else
self
.
SMALL_NUMBER_OF_RECORDS
fullTableName
=
db
.
getName
()
+
'.'
+
regTableName
sql
=
"insert into {} values "
.
format
(
fullTableName
)
for
j
in
range
(
numRecords
):
# number of records per table
nextInt
=
db
.
getNextInt
()
nextTick
=
db
.
getNextTick
()
sql
+=
"('{}', {});"
.
format
(
nextTick
,
nextInt
)
dbc
.
execute
(
sql
)
fullTableName
=
db
.
getName
()
+
'.'
+
regTableName
# self._lockTable(fullTableName) # "create table" below. Stop it if the table is "locked"
sTable
.
ensureTable
(
self
,
wt
.
getDbConn
(),
db
.
getName
(),
regTableName
)
# Ensure the table exists
# self._unlockTable(fullTableName)
def
_addData
(
self
,
db
,
dbc
,
regTableName
,
te
:
TaskExecutor
):
# implied: NOT in batches
numRecords
=
self
.
LARGE_NUMBER_OF_RECORDS
if
gConfig
.
larger_data
else
self
.
SMALL_NUMBER_OF_RECORDS
for
j
in
range
(
self
.
LARGE_NUMBER_OF_RECORDS
if
gConfig
.
larger_data
else
self
.
SMALL_NUMBER_OF_RECORDS
):
# number of records per table
for
j
in
range
(
numRecords
):
# number of records per table
nextInt
=
db
.
getNextInt
()
nextTick
=
db
.
getNextTick
()
if
gConfig
.
record_ops
:
...
...
@@ -1993,12 +1986,33 @@ class TaskAddData(StateTransitionTask):
self
.
fAddLogDone
.
flush
()
os
.
fsync
(
self
.
fAddLogDone
)
def
_executeInternal
(
self
,
te
:
TaskExecutor
,
wt
:
WorkerThread
):
# ds = self._dbManager # Quite DANGEROUS here, may result in multi-thread client access
db
=
self
.
_db
dbc
=
wt
.
getDbConn
()
numTables
=
self
.
LARGE_NUMBER_OF_TABLES
if
gConfig
.
larger_data
else
self
.
SMALL_NUMBER_OF_TABLES
numRecords
=
self
.
LARGE_NUMBER_OF_RECORDS
if
gConfig
.
larger_data
else
self
.
SMALL_NUMBER_OF_RECORDS
tblSeq
=
list
(
range
(
numTables
))
random
.
shuffle
(
tblSeq
)
# now we have random sequence
for
i
in
tblSeq
:
if
(
i
in
self
.
activeTable
):
# wow already active
print
(
"x"
,
end
=
""
,
flush
=
True
)
# concurrent insertion
else
:
self
.
activeTable
.
add
(
i
)
# marking it active
sTable
=
db
.
getFixedSuperTable
()
regTableName
=
self
.
getRegTableName
(
i
)
# "db.reg_table_{}".format(i)
fullTableName
=
db
.
getName
()
+
'.'
+
regTableName
# self._lockTable(fullTableName) # "create table" below. Stop it if the table is "locked"
sTable
.
ensureTable
(
self
,
wt
.
getDbConn
(),
db
.
getName
(),
regTableName
)
# Ensure the table exists
# self._unlockTable(fullTableName)
self
.
activeTable
.
discard
(
i
)
# not raising an error, unlike remove
if
Dice
.
throw
(
1
)
==
0
:
# 1 in 2 chance
self
.
_addData
(
db
,
dbc
,
regTableName
,
te
)
else
:
self
.
_addDataInBatch
(
db
,
dbc
,
regTableName
,
te
)
self
.
activeTable
.
discard
(
i
)
# not raising an error, unlike remove
class
ThreadStacks
:
# stack info for all threads
...
...
@@ -2022,13 +2036,14 @@ class ThreadStacks: # stack info for all threads
'__init__'
]:
# the thread that extracted the stack
continue
# ignore
# Now print
print
(
"
\n
<----- Thread Info for ID: {}"
.
format
(
thNid
))
print
(
"
\n
<----- Thread Info for LWP/ID: {} (Execution stopped at Bottom Frame) <-----"
.
format
(
thNid
))
stackFrame
=
0
for
frame
in
stack
:
# print(frame)
print
(
"File {filename}, line {lineno}, in {name}"
.
format
(
filename
=
frame
.
filename
,
lineno
=
frame
.
lineno
,
name
=
frame
.
name
))
print
(
"
[{sf}]
File {filename}, line {lineno}, in {name}"
.
format
(
sf
=
stackFrame
,
filename
=
frame
.
filename
,
lineno
=
frame
.
lineno
,
name
=
frame
.
name
))
print
(
" {}"
.
format
(
frame
.
line
))
print
(
"-----> End of Thread Info
\n
"
)
print
(
"-----> End of Thread Info
----->
\n
"
)
class
ClientManager
:
def
__init__
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录