Add timeouts to request-path external calls and reuse per-process clients #886
Copy link
Copy link
Open
Labels
app: backendTask implementation touches the backendTask implementation touches the backend
Milestone
Description
Problem
The request path makes external calls with no timeout and rebuilds expensive clients on every request.
lib/external_publications.py:261and:561callrequests.getwith no timeout.lib/orcid.py:21and:54build anorcid.PublicAPIclient per call, with no timeout.deps.py:31and:35build the HGVS data provider and aSeqRepoon every request. Gene autocomplete runs a UTA query per call.
A stalled upstream holds a threadpool slot and a database connection until the load balancer gives up.
Scope
- Route the publication and ORCID calls through the default-timeout session in
lib/http.pyfrom Worker outbound calls have no timeout #883, with a timeout constant per service. - Build the HGVS data provider and
SeqRepoonce per process and reuse them. - Cache gene autocomplete results.
Acceptance criteria
- Tests assert the timeout each request-path call passes.
- A test asserts two requests get the same data provider instance.
- ruff
S113passes onsrc/mavedb/libandsrc/mavedb/routers.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
app: backendTask implementation touches the backendTask implementation touches the backend
Activity