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

Signed-off-by: Nils Matteson <nilsmatteson@icloud.com>

Nils Matteson committed Aug 7, 2026 at 17:29 UTC 1c008a346c1141dbd6bee3816312f1467ed98b8a
1 file changed +2 -3
vllm/usage/usage_lib.py
+2 -3
@@ -19,7 +19,6 @@ import requests
19 import torch
20
21 import vllm.envs as envs
22 -from vllm.connections import global_http_connection
22 from vllm.logger import init_logger
23 from vllm.utils.platform_utils import cuda_get_device_properties
24 from vllm.version import __version__ as VLLM_VERSION
@@ -265,8 +264,8 @@ class UsageMessage:
264
265 def _send_to_server(self, data: dict[str, Any]) -> None:
266 try:
268 - global_http_client = global_http_connection.get_sync_client()
269 - global_http_client.post(_USAGE_STATS_SERVER, json=data)
267 + with requests.Session() as client:
268 + client.post(_USAGE_STATS_SERVER, json=data)
269 except requests.exceptions.RequestException:
270 # silently ignore unless we are using debug log
271 logging.debug("Failed to send usage data to server")