Skip to content

Commit

Permalink
Increase timeout for RemoteButler HTTP requests
Browse files Browse the repository at this point in the history
The default HTTPX timeout of 5 seconds is much too low when communicating with Butler server -- many requests can exceed that while waiting for the database to respond.
  • Loading branch information
dhirving committed Aug 29, 2024
1 parent e36b17d commit 6b79966
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion python/lsst/daf/butler/remote_butler/_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,18 @@ def __init__(self, server_url: str, http_client: httpx.Client | None = None):
if http_client is not None:
self.http_client = http_client
else:
self.http_client = httpx.Client()
self.http_client = httpx.Client(
# This timeout is fairly conservative. This value isn't the
# maximum amount of time the request can take -- it's the
# maximum amount of time to wait after receiving the last chunk
# of data from the server.
#
# Long-running, streamed queries send a keep-alive every 15
# seconds. However, unstreamed operations like
# queryCollections can potentially take a while if the database
# is under duress.
timeout=120 # seconds
)
self._cache = RemoteButlerCache()

@staticmethod
Expand Down

0 comments on commit 6b79966

Please sign in to comment.