Skip to content

fix(ensembl): implement resilient request retry, backoff, and fallback resolution (v0.5.1) - #17

Merged
engkinandatama merged 4 commits into
CORE-Lab-Research:mainfrom
engkinandatama:feat/ensembl-graphql-migration-v0.5.1
Sep 29, 2026
Merged

engkinandatama merged 4 commits into
CORE-Lab-Research:mainfrom
engkinandatama:feat/ensembl-graphql-migration-v0.5.1

Conversation

@engkinandatama

Copy link
Copy Markdown
Collaborator

Description

Addresses and resolves Ensembl REST service instability and timeouts observed post-e116 release (closing #4).

Key Changes

  1. Adaptive Request Pipeline (EnsemblAdapter._get_json):
    • Centralized network access with automatic rate-limit token bucket acquisition.
    • 4-stage exponential backoff handling HTTP 429 (Rate Limit) and HTTP 500/502/503/504 errors.
    • Raised default Ensembl request timeout to 25.0s (RateLimitConfig.ENSEMBL_TIMEOUT_SEC).
  2. Endpoint Fallback Logic:
    • fetch_by_id: Fallback gracefully from expand=1 to expand=0 when Ensembl internal server errors occur on complex gene models, recovering full transcript models via symbol lookup.
    • fetch_orthologs: If /homology/id/ endpoint encounters HTTP 500/503 ("No server available"), automatically falls back to /homology/symbol/{source}/{symbol}, guaranteeing 100% ortholog retrieval.
  3. Test Suite Reactivation:
    • Removed @pytest.mark.skip from all 5 Ensembl unit and MCP integration tests in tests/test_resolver.py and tests/test_server.py.
    • All 22 resolver, server, and end-to-end pipeline tests pass cleanly without degradation.
  4. Version Bump:
    • Bumped package version to 0.5.1 in pyproject.toml.

Closes #4

@engkinandatama engkinandatama self-assigned this Sep 29, 2026
@engkinandatama engkinandatama added bug Something isn't working enhancement New feature or request labels Sep 29, 2026
@engkinandatama
engkinandatama merged commit 3ddf2eb into CORE-Lab-Research:main Sep 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate EnsemblAdapter from legacy REST to GraphQL API

1 participant