Exemple #1
0
def get_stack_info():
    'Returns a string showing the current stack for each running thread.'
    io = StringIO()
    where(duplicates = True, stream = io)
    stack_info = io.getvalue()

    return '\n\n'.join([datetime.now().isoformat(), stack_info])
Exemple #2
0
def get_stack_info():
    'Returns a string showing the current stack for each running thread.'
    io = StringIO()
    where(duplicates=True, stream=io)
    stack_info = io.getvalue()

    return '\n\n'.join([datetime.now().isoformat(), stack_info])
Exemple #3
0
def get_thread_stacks():
    'Returns a string showing the current stack for each active thread.'

    from common.commandline import where
    from cStringIO import StringIO
    io = StringIO()
    where(duplicates = True, stream = io)
    return io.getvalue()
Exemple #4
0
    def run(self):
        time.sleep(self.wait)

        threads = list(threading.enumerate())
        if threads:
            print 'Remaining non-daemon threads:'
            for thread in threads:
                if not thread.isDaemon():
                    print ' ', thread

        collect_garbage_and_report()

        if self.sysexit:
            try:
                import common.commandline as cc
                cc.where()
            except Exception:
                traceback.print_exc()
            print >>sys.stderr, 'forcing shutdown...'
            os._exit(1)