[Bugfix] Close usage telemetry HTTP sessions (#51219)

Signed-off-by: Nils Matteson <nilsmatteson@icloud.com>
This commit is contained in:
Nils Matteson
2026-08-08 00:29:36 +00:00
committed by GitHub
parent e644c8cd8c
commit 1c008a346c
+2 -3
View File
@@ -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")