mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-04-07 16:37:09 +08:00
Replace zmq.asyncio.Context().term() with zmq.asyncio.Context().destroy(linger=0) for immediate termination
Signed-off-by: clark <panf2333@gmail.com>
This commit is contained in:
parent
b7ffb43792
commit
897db7b93d
@ -34,7 +34,7 @@ async def lifespan(app: FastAPI):
|
||||
yield
|
||||
## close zmq context
|
||||
logger.info("term zmqctx")
|
||||
await app.state.zmqctx.term()
|
||||
app.state.zmqctx.destroy(linger=0)
|
||||
|
||||
app = FastAPI(lifespan=lifespan)
|
||||
|
||||
|
||||
@ -108,7 +108,7 @@ async def serve_zmq(arg, zmq_server_port: int, app: FastAPI) -> None:
|
||||
# We never get here but clean up anyhow
|
||||
clients.close()
|
||||
workers.close()
|
||||
context.term()
|
||||
context.destroy(linger=0)
|
||||
|
||||
def _add_shutdown_handlers(app: FastAPI, server: uvicorn.Server) -> None:
|
||||
"""Adds handlers for fatal errors that should crash the server"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user