MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / print_alive_threads

Function print_alive_threads

tensorrt_llm/executor/utils.py:156–172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154
155
156def print_alive_threads():
157 assert enable_llm_debug(
158 ), "print_alive_threads must be called with enable_llm_debug() enabled"
159
160 # Print all alive threads for debugging
161 alive_threads = [t for t in threading.enumerate() if t.is_alive()]
162 logger.info(
163 f'All alive threads after shutdown: {[t.name for t in alive_threads]}\n',
164 "red")
165 for t in alive_threads:
166 logger.info(f'Thread {t.name} (daemon={t.daemon}) is still alive')
167 # Get the stack trace for this thread
168 stack = sys._current_frames().get(t.ident)
169 if stack is not None:
170 logger.info(f'Stack trace for thread {t.name}:')
171 traceback.print_stack(stack, file=sys.stdout)
172 logger.info('')

Callers 1

shutdownMethod · 0.85

Calls 3

enable_llm_debugFunction · 0.90
infoMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected