[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:
parent
bf7c16d6d9
commit
f0dcf52159
|
@ -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 = {
|
||||
|
|
|
@ -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 = []
|
||||
|
||||
|
|
Loading…
Reference in New Issue