[Bugfix] Close usage telemetry HTTP sessions (#51219)
Signed-off-by: Nils Matteson <nilsmatteson@icloud.com>
This commit is contained in:
@@ -19,7 +19,6 @@ import requests
|
||||
import torch
|
||||
|
||||
import vllm.envs as envs
|
||||
from vllm.connections import global_http_connection
|
||||
from vllm.logger import init_logger
|
||||
from vllm.utils.platform_utils import cuda_get_device_properties
|
||||
from vllm.version import __version__ as VLLM_VERSION
|
||||
@@ -265,8 +264,8 @@ class UsageMessage:
|
||||
|
||||
def _send_to_server(self, data: dict[str, Any]) -> None:
|
||||
try:
|
||||
global_http_client = global_http_connection.get_sync_client()
|
||||
global_http_client.post(_USAGE_STATS_SERVER, json=data)
|
||||
with requests.Session() as client:
|
||||
client.post(_USAGE_STATS_SERVER, json=data)
|
||||
except requests.exceptions.RequestException:
|
||||
# silently ignore unless we are using debug log
|
||||
logging.debug("Failed to send usage data to server")
|
||||
|
||||
Reference in New Issue
Block a user