mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-09-09 14:57:06 +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
|
yield
|
||||||
## close zmq context
|
## close zmq context
|
||||||
logger.info("term zmqctx")
|
logger.info("term zmqctx")
|
||||||
await app.state.zmqctx.term()
|
app.state.zmqctx.destroy(linger=0)
|
||||||
|
|
||||||
app = FastAPI(lifespan=lifespan)
|
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
|
# We never get here but clean up anyhow
|
||||||
clients.close()
|
clients.close()
|
||||||
workers.close()
|
workers.close()
|
||||||
context.term()
|
context.destroy(linger=0)
|
||||||
|
|
||||||
def _add_shutdown_handlers(app: FastAPI, server: uvicorn.Server) -> None:
|
def _add_shutdown_handlers(app: FastAPI, server: uvicorn.Server) -> None:
|
||||||
"""Adds handlers for fatal errors that should crash the server"""
|
"""Adds handlers for fatal errors that should crash the server"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user