File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 103103from  vllm .usage .usage_lib  import  UsageContext 
104104from  vllm .utils  import  (Device , FlexibleArgumentParser , decorate_logs ,
105105                        is_valid_ipv6_address , set_ulimit )
106+ from  vllm .v1 .engine .exceptions  import  EngineDeadError 
106107from  vllm .v1 .metrics .prometheus  import  get_prometheus_registry 
107108from  vllm .version  import  __version__  as  VLLM_VERSION 
108109
@@ -351,8 +352,11 @@ def engine_client(request: Request) -> EngineClient:
351352@router .get ("/health" , response_class = Response ) 
352353async  def  health (raw_request : Request ) ->  Response :
353354    """Health check.""" 
354-     await  engine_client (raw_request ).check_health ()
355-     return  Response (status_code = 200 )
355+     try :
356+         await  engine_client (raw_request ).check_health ()
357+         return  Response (status_code = 200 )
358+     except  EngineDeadError :
359+         return  Response (status_code = 503 )
356360
357361
358362@router .get ("/load" ) 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments