Bound PubMed transport retries and preserve cached text on failure - #79
Conversation
|
Claude finished @cmungall's task in 4m 21s —— View job Review: bounded PubMed transport retries
Overall this is a solid, well-reasoned change. The retry boundary is in the right place (transport only, parsing outside), Comments below, roughly in severity order. 1. A successful-but-empty efetch response is treated as a transport failure
The same applies to permanent errors: The stale-cache motivation only really needs the 2. The read-path except tuple can still let a network error abort the run
Two nits in the same tuple: 3. Sub-second timeout margins plus exact request-count assertions look flake-proneThe fixture opens local handles with Widening to something like 4.
|
|
Review disposition in 722a567:
The full local suite and Python 3.10–3.13 CI are running on the updated commit; final results will be recorded in the PR description. |
|
Claude finished @cmungall's task in 5m 3s —— View job Review: bounded PubMed transport retries (pass 2, after
|
|
Follow-up review assessed; no further code changes are needed for this PR. Biopython's minimum supported 1.80 implementation already documents that XML responses are returned in binary mode and that The empty/rejected article behavior remains the deliberately chosen stale-safe fetch contract described above; HTTP 400 previously raised, and expanding title-only/metadata-only refresh behavior would need separate cache-quality semantics. Live PMC provider retries and the remaining cosmetic/test nits are outside this bounded fix. Final local evidence at 722a567: 840 tests passed via |
A dropped NCBI response could abort validation, leak a response handle, or leave only summary metadata available after an article fetch failed. Read complete summary/article responses with bounded transport retries, close handles on every exit, and return
Noneafter exhaustion so validation can continue and eligible stale cache entries remain useful without being overwritten.Behavior
The legacy PMC fetch methods covered by #64 are unchanged. A successfully fetched record that genuinely has no abstract still returns metadata with
unavailablecontent.Validation
just doctest: 200 passed.uv run mypy src tests: passed;uv run ruff check .: passed;git diff --check: passed.just teston 722a567: 840 passed (354.97 seconds), followed by passing mypy and ruff checks.Retry limits bound attempts, not elapsed wall time; Bio.Entrez retains its own opening delays. The #65 HTML-cache exception belongs to its separate PR and may require combining nearby troubleshooting edits when both land.
Closes #66
Closes #75