Skip to content

Commit 09dab2e

Browse files
update comment
1 parent 893ee0e commit 09dab2e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

gen3workflow/app.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,16 @@ async def get_status():
6666
root_path=config["DOCS_URL_PREFIX"],
6767
generate_unique_id_function=generate_unique_route_id,
6868
)
69-
# TODO check ideal timeout for AWS calls
70-
app.async_client = httpx_client or httpx.AsyncClient(timeout=300)
69+
70+
# `async_client` is used to hit the TES API, the Arborist service and AWS S3.
71+
# Calls to S3 tend to timeout when uploading large files (and we might also be rate-limited).
72+
# AsyncHTTPTransport supports retrying on httpx.ConnectError or httpx.ConnectTimeout.
73+
# The `httpx_client` parameter is not meant to be used in production. It allows mocking
74+
# external calls when testing.
75+
app.async_client = httpx_client or httpx.AsyncClient(
76+
transport=httpx.AsyncHTTPTransport(retries=3), timeout=120
77+
)
78+
7179
app.include_router(ga4gh_tes_router, tags=["GA4GH TES"])
7280
app.include_router(s3_router, tags=["S3"])
7381
app.include_router(storage_router, tags=["Storage"])

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ async def handle_request(request: Request):
349349
httpx_client_function = getattr(httpx.AsyncClient(), request.method.lower())
350350
return await httpx_client_function(url)
351351

352-
# set the httpx clients used by the app and by the Arborist client to mock clients that
352+
# the httpx clients used by the app and by gen3authz are set to mock clients that
353353
# call `handle_request`
354354
mock_httpx_client = httpx.AsyncClient(transport=httpx.MockTransport(handle_request))
355355
app = get_app(httpx_client=mock_httpx_client)

0 commit comments

Comments
 (0)