@@ -652,25 +652,19 @@ def _set_envs_and_config(server_args: ServerArgs):
652652 "Please reinstall the latest version with `pip install sgl-kernel --force-reinstall`" ,
653653 )
654654
655- def sigchld_handler (signum , frame ):
656- pid , exitcode = os .waitpid (0 , os .WNOHANG )
657- if exitcode != 0 :
658- logger .warning (
659- f"Child process unexpectedly failed with { exitcode = } . { pid = } "
655+ if True : # Keep this check for internal code compatibility
656+ # Register the signal handler.
657+ # The child processes will send SIGQUIT to this process when any error happens
658+ # This process then clean up the whole process tree
659+ # Note: This sigquit handler is used in the launch phase, and may be replaced by
660+ # the running_phase_sigquit_handler in the tokenizer manager after the grpc server is launched.
661+ def launch_phase_sigquit_handler (signum , frame ):
662+ logger .error (
663+ "Received sigquit from a child process. It usually means the child failed."
660664 )
665+ kill_process_tree (os .getpid ())
661666
662- signal .signal (signal .SIGCHLD , sigchld_handler )
663-
664- # Register the signal handler.
665- # The child processes will send SIGQUIT to this process when any error happens
666- # This process then clean up the whole process tree
667- def sigquit_handler (signum , frame ):
668- logger .error (
669- "Received sigquit from a child process. It usually means the child failed."
670- )
671- kill_process_tree (os .getpid ())
672-
673- signal .signal (signal .SIGQUIT , sigquit_handler )
667+ signal .signal (signal .SIGQUIT , launch_phase_sigquit_handler )
674668
675669 # Set mp start method
676670 mp .set_start_method ("spawn" , force = True )
0 commit comments