[FIX] instrumentation to debug a deadlock probably due to a race condition in

the test cursor

bzr revid: al@openerp.com-20140411143645-ojb4t9plop4dmizh
This commit is contained in:
Antony Lesuisse 2014-04-11 16:36:45 +02:00
parent bf7c16d6d9
commit f0dcf52159
2 changed files with 7 additions and 1 deletions

View File

@ -233,6 +233,7 @@ class HttpCase(TransactionCase):
_logger.info("phantom_run execution finished")
def _wait_remaining_requests(self):
t0 = int(time.time())
for thread in threading.enumerate():
if thread.name.startswith('openerp.service.http.request.'):
while thread.isAlive():
@ -240,6 +241,11 @@ class HttpCase(TransactionCase):
# and would prevent the forced shutdown.
thread.join(0.05)
time.sleep(0.05)
t1 = int(time.time())
if t0 != t1:
_logger.info('remaining requests')
openerp.tools.misc.dumpstacks()
t0 = t1
def phantom_jsfile(self, jsfile, timeout=60, **kw):
options = {

View File

@ -1171,7 +1171,7 @@ class ConstantMapping(Mapping):
return self._value
def dumpstacks(sig, frame):
def dumpstacks(sig=None, frame=None):
""" Signal handler: dump a stack trace for each existing thread."""
code = []