Skip to content
Snippets Groups Projects
Commit 4238bc99 authored by Olivier Dony's avatar Olivier Dony
Browse files

[FIX] openerp-server: allow missing thread names in dump_stacks

Report-printing threads don't seem to be included
in the list of active threads, but do need to
be dumped as well.

bzr revid: odo@openerp.com-20120315181355-phtkn2uhy638ei1e
parent 975667d1
No related branches found
No related tags found
No related merge requests found
...@@ -169,7 +169,7 @@ def dumpstacks(sig, frame): ...@@ -169,7 +169,7 @@ def dumpstacks(sig, frame):
id2name = dict([(threadId, thread.getName()) for threadId, thread in thread_map.items()]) id2name = dict([(threadId, thread.getName()) for threadId, thread in thread_map.items()])
code = [] code = []
for threadId, stack in sys._current_frames().items(): for threadId, stack in sys._current_frames().items():
code.append("\n# Thread: %s(%d)" % (id2name[threadId], threadId)) code.append("\n# Thread: %s(%d)" % (id2name.get(threadId,'n/a'), threadId))
for filename, lineno, name, line in traceback.extract_stack(stack): for filename, lineno, name, line in traceback.extract_stack(stack):
code.append('File: "%s", line %d, in %s' % (filename, lineno, name)) code.append('File: "%s", line %d, in %s' % (filename, lineno, name))
if line: if line:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment