Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6cb97b37
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看板
提交
6cb97b37
编写于
6月 28, 2020
作者:
S
Steven Li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Discovered Python client problem, ready to file JIRA
上级
2a8b92a7
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
10 deletion
+29
-10
tests/pytest/crash_gen.py
tests/pytest/crash_gen.py
+29
-10
未找到文件。
tests/pytest/crash_gen.py
浏览文件 @
6cb97b37
...
...
@@ -270,7 +270,7 @@ class ThreadCoordinator:
# Get ready for next step
logger
.
debug
(
"<-- Step {} finished"
.
format
(
self
.
_curStep
))
self
.
_curStep
+=
1
# we are about to get into next step. TODO: race condition here!
logger
.
debug
(
"
\r\n
--> Step {} starts with main thread waking up"
.
format
(
self
.
_curStep
))
# Now not all threads had time to go to sleep
logger
.
debug
(
"
\r\n
\n
--> Step {} starts with main thread waking up"
.
format
(
self
.
_curStep
))
# Now not all threads had time to go to sleep
# A new TE for the new step
if
not
failed
:
# only if not failed
...
...
@@ -452,6 +452,7 @@ class DbConn:
# Open connection
self
.
_tdSql
=
TDSql
()
self
.
_tdSql
.
init
(
self
.
_cursor
)
logger
.
debug
(
"[DB] data connection opened"
)
self
.
isOpen
=
True
def
resetDb
(
self
):
# reset the whole database, etc.
...
...
@@ -470,6 +471,7 @@ class DbConn:
if
(
not
self
.
isOpen
):
raise
RuntimeError
(
"Cannot clean up database until connection is open"
)
self
.
_tdSql
.
close
()
logger
.
debug
(
"[DB] Database connection closed"
)
self
.
isOpen
=
False
def
execute
(
self
,
sql
):
...
...
@@ -1010,13 +1012,19 @@ class Task():
self
.
_executeInternal
(
te
,
wt
)
# TODO: no return value?
except
taos
.
error
.
ProgrammingError
as
err
:
errno2
=
0x80000000
+
err
.
errno
# positive error number
if
(
errno2
in
[
0x200
,
0x360
,
0x362
,
0x3
81
,
0x380
,
0x600
])
:
# allowed errors
if
(
errno2
in
[
0x200
,
0x360
,
0x362
,
0x3
6A
,
0x36B
,
0x381
,
0x380
,
0x383
,
0x600
])
:
# allowed errors
self
.
logDebug
(
"[=] Acceptable Taos library exception: errno=0x{:X}, msg: {}, SQL: {}"
.
format
(
errno2
,
err
,
self
.
_lastSql
))
print
(
"e"
,
end
=
""
,
flush
=
True
)
self
.
_err
=
err
else
:
self
.
logDebug
(
"[=] Unexpected Taos library exception: errno=0x{:X}, msg: {}, SQL: {}"
.
format
(
errno2
,
err
,
self
.
_lastSql
))
raise
errMsg
=
"[=] Unexpected Taos library exception: errno=0x{:X}, msg: {}, SQL: {}"
.
format
(
errno2
,
err
,
self
.
_lastSql
)
self
.
logDebug
(
errMsg
)
if
gConfig
.
debug
:
raise
# so that we see full stack
else
:
# non-debug
print
(
"
\n\n
----------------------------
\n
Program ABORTED Due to Unexpected TAOS Error:
\n\n
{}
\n
"
+
"--------------
\n
"
.
format
(
errMsg
))
sys
.
exit
(
-
1
)
except
:
self
.
logDebug
(
"[=] Unexpected exception, SQL: {}"
.
format
(
self
.
_lastSql
))
raise
...
...
@@ -1388,7 +1396,8 @@ class LoggingFilter(logging.Filter):
if
(
record
.
levelno
>=
logging
.
INFO
)
:
return
True
# info or above always log
msg
=
record
.
msg
# print("type = {}, value={}".format(type(msg), msg))
# sys.exit()
...
...
@@ -1398,6 +1407,11 @@ class LoggingFilter(logging.Filter):
# return False
return
True
class
MyLoggingAdapter
(
logging
.
LoggerAdapter
):
def
process
(
self
,
msg
,
kwargs
):
return
"[{}]{}"
.
format
(
threading
.
get_ident
()
%
10000
,
msg
),
kwargs
# return '[%s] %s' % (self.extra['connid'], msg), kwargs
class
MainExec
:
@
classmethod
def
runClient
(
cls
):
...
...
@@ -1493,16 +1507,21 @@ def main():
# parser.print_help()
# sys.exit()
# Logging Stuff
global
logger
logger
=
logging
.
getLogger
(
'CrashGen'
)
logger
.
addFilter
(
LoggingFilter
())
_logger
=
logging
.
getLogger
(
'CrashGen'
)
# real logger
_logger
.
addFilter
(
LoggingFilter
())
ch
=
logging
.
StreamHandler
()
_logger
.
addHandler
(
ch
)
logger
=
MyLoggingAdapter
(
_logger
,
[])
# Logging adapter, to be used as a logger
if
(
gConfig
.
debug
):
logger
.
setLevel
(
logging
.
DEBUG
)
# default seems to be INFO
else
:
logger
.
setLevel
(
logging
.
INFO
)
ch
=
logging
.
StreamHandler
()
logger
.
addHandler
(
ch
)
# Run server or client
if
gConfig
.
run_tdengine
:
# run server
MainExec
.
runService
()
else
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录