From 414b4635569145ed277bfe0e0e540d62430e0bb8 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Mon, 7 Nov 2022 09:23:04 -0500 Subject: [PATCH] Use built-in treq timeout feature. --- src/allmydata/storage/http_client.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/allmydata/storage/http_client.py b/src/allmydata/storage/http_client.py index 7fcf8114c..d6121aba2 100644 --- a/src/allmydata/storage/http_client.py +++ b/src/allmydata/storage/http_client.py @@ -415,12 +415,10 @@ class StorageClientGeneral(object): Return the version metadata for the server. """ url = self._client.relative_url("/storage/v1/version") - result = self._client.request("GET", url) # 1. Getting the version should never take particularly long. # 2. Clients rely on the version command for liveness checks of servers. - result.addTimeout(5, self._client._clock) - - response = yield result + # Thus, a short timeout. + response = yield self._client.request("GET", url, timeout=5) decoded_response = yield _decode_cbor(response, _SCHEMAS["get_version"]) returnValue(decoded_response)