File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# SPDX-License-Identifier: Apache-2.0
22# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3+ import faulthandler
34import multiprocessing
45import os
56import pickle
67import queue
78import signal
9+ import sys
810import threading
911import time
1012import traceback
@@ -810,6 +812,14 @@ def signal_handler(signum, frame):
810812 # Either SIGTERM or SIGINT will terminate the worker
811813 signal .signal (signal .SIGTERM , signal_handler )
812814 signal .signal (signal .SIGINT , signal_handler )
815+ if hasattr (signal , "SIGUSR2" ):
816+
817+ def dump_stack_handler (signum , frame ):
818+ del frame
819+ logger .warning ("WorkerProc dumping stacks for signal %d" , signum )
820+ faulthandler .dump_traceback (file = sys .stderr , all_threads = True )
821+
822+ signal .signal (signal .SIGUSR2 , dump_stack_handler )
813823
814824 worker = None
815825 ready_writer = kwargs .pop ("ready_pipe" )
You can’t perform that action at this time.
0 commit comments