Skip to content

Commit 0f14463

Browse files
authored
Merge branch 'main' into fix-env-cli-deploy
2 parents 2722467 + 393ec7c commit 0f14463

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/_bentoml_impl/server/proxy.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import asyncio
34
import contextlib
45
import logging
56
import typing as t
@@ -98,7 +99,11 @@ async def lifespan(
9899
finally:
99100
if proc is not None:
100101
proc.terminate()
101-
await proc.wait()
102+
try:
103+
await asyncio.wait_for(proc.wait(), timeout=30.0)
104+
except asyncio.TimeoutError:
105+
proc.kill()
106+
await proc.wait()
102107

103108
assert service.has_custom_command(), "Service does not have custom command"
104109
app = fastapi.FastAPI(lifespan=lifespan)

0 commit comments

Comments
 (0)