From f3a63c4f177de6852adf160cc2669ddbaaee53cd Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Fri, 22 Sep 2023 17:49:24 +0800 Subject: [PATCH] fix: do not use UDS on WSL (#4204) --- src/bentoml/serve.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bentoml/serve.py b/src/bentoml/serve.py index 9047f0a3468..f3915f7f31c 100644 --- a/src/bentoml/serve.py +++ b/src/bentoml/serve.py @@ -5,6 +5,7 @@ import json import logging import os +import platform import shlex import shutil import sys @@ -43,6 +44,7 @@ API_SERVER_NAME = "_bento_api_server" PROMETHEUS_SERVER_NAME = "_prometheus_server" +IS_WSL = "microsoft-standard" in platform.release() @inject @@ -283,7 +285,7 @@ def serve_http_production( uds_path = None timeout_args = ["--timeout", str(timeout)] if timeout else [] - if psutil.POSIX: + if psutil.POSIX and not IS_WSL: # use AF_UNIX sockets for Circus uds_path = tempfile.mkdtemp() for runner in svc.runners: