Commit e632443f authored by Sebastien Robin's avatar Sebastien Robin

Revert "Add counter to manage_debug_thread SQL queries"

This reverts commit c00318de.
parent c00318de
...@@ -69,8 +69,7 @@ def dump_threads(): ...@@ -69,8 +69,7 @@ def dump_threads():
while f is not None: while f is not None:
code = f.f_code code = f.f_code
if code is DB._query.func_code: if code is DB._query.func_code:
mysql_info = "\nMySQL query #%s:\n%s\n" % (f.f_locals['self']._count, mysql_info = "\nMySQL query:\n%s\n" % f.f_locals['query']
f.f_locals['query'])
break break
f = f.f_back f = f.f_back
except ImportError: except ImportError:
......
...@@ -319,7 +319,6 @@ class DB(TM): ...@@ -319,7 +319,6 @@ class DB(TM):
because they are bound to the connection. This check can be because they are bound to the connection. This check can be
overridden by passing force_reconnect with True value. overridden by passing force_reconnect with True value.
""" """
self._count += 1
try: try:
self.db.query(query) self.db.query(query)
except OperationalError, m: except OperationalError, m:
...@@ -333,7 +332,6 @@ class DB(TM): ...@@ -333,7 +332,6 @@ class DB(TM):
raise raise
# Hm. maybe the db is hosed. Let's restart it. # Hm. maybe the db is hosed. Let's restart it.
self._forceReconnection() self._forceReconnection()
self._count += 1
self.db.query(query) self.db.query(query)
except ProgrammingError, exception: except ProgrammingError, exception:
LOG('ZMySQLDA', ERROR, 'query failed: %s' % (query,)) LOG('ZMySQLDA', ERROR, 'query failed: %s' % (query,))
...@@ -401,7 +399,6 @@ class DB(TM): ...@@ -401,7 +399,6 @@ class DB(TM):
def _begin(self, *ignored): def _begin(self, *ignored):
"""Begin a transaction (when TM is enabled).""" """Begin a transaction (when TM is enabled)."""
self._count = 0
try: try:
self._transaction_begun = True self._transaction_begun = True
# Ping the database to reconnect if connection was closed. # Ping the database to reconnect if connection was closed.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment