Skip to content

Commit 2500b0d

Browse files
yihong0618lk-chen
authored andcommitted
[BugFix] make sure socket close (vllm-project#15875)
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
1 parent cf1d3bd commit 2500b0d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

vllm/entrypoints/openai/api_server.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,9 +1098,10 @@ def _listen_addr(a: str) -> str:
10981098
)
10991099

11001100
# NB: Await server shutdown only after the backend context is exited
1101-
await shutdown_task
1102-
1103-
sock.close()
1101+
try:
1102+
await shutdown_task
1103+
finally:
1104+
sock.close()
11041105

11051106

11061107
if __name__ == "__main__":

0 commit comments

Comments
 (0)