Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
erp5
Commits
5ef26c24
Commit
5ef26c24
authored
Aug 16, 2012
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Custom hack in DeadlockDebbugger to display current mysql query, if any
parent
01e4bf93
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
product/DeadlockDebugger/dumper.py
product/DeadlockDebugger/dumper.py
+15
-3
No files found.
product/DeadlockDebugger/dumper.py
View file @
5ef26c24
...
...
@@ -62,12 +62,24 @@ def dump_threads():
if
reqinfo
:
reqinfo
=
" (%s)"
%
reqinfo
mysql_info
=
'no query'
f
=
frame
try
:
from
Products.ZMySQLDA.db
import
DB
while
f
is
not
None
:
code
=
f
.
f_code
if
code
is
DB
.
_query
.
func_code
:
mysql_info
=
str
(
f
.
f_locals
[
'query'
])
f
=
f
.
f_back
except
ImportError
:
pass
output
=
StringIO
()
traceback
.
print_stack
(
frame
,
file
=
output
)
res
.
append
(
"Thread %s%s:
\
n
%s"
%
(
thread_id
,
reqinfo
,
output
.
getvalue
()))
res
.
append
(
"Thread %s%s:
\
n
%s
\
n
MySQL query:
\
n
%s
\
n
"
%
(
thread_id
,
reqinfo
,
output
.
getvalue
()
,
mysql_info
))
res
.
append
(
"End of dump"
)
res
.
append
(
"End of dump
\
n
"
)
result
=
'
\
n
'
.
join
(
res
)
if
isinstance
(
result
,
unicode
):
result
=
result
.
encode
(
'utf-8'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment