Skip to content

Commit

Permalink
Call faulthandler.enable() and also register on SIGUSR1
Browse files Browse the repository at this point in the history
  • Loading branch information
pathorn authored and Nikola Borisov committed Jan 31, 2024
1 parent eee6ed3 commit 87fd551
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vllm/entrypoints/openai/api_server.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import argparse
import asyncio
import json
import faulthandler
import signal
from contextlib import asynccontextmanager
import os
import importlib
Expand Down Expand Up @@ -178,6 +180,10 @@ async def create_completion(request: CompletionRequest, raw_request: Request):
if __name__ == "__main__":
args = parse_args()

faulthandler.enable(all_threads=True)
if hasattr(signal, 'SIGUSR1'):
faulthandler.register(signal.SIGUSR1)

app.add_middleware(
CORSMiddleware,
allow_origins=args.allowed_origins,
Expand Down

0 comments on commit 87fd551

Please sign in to comment.