Skip to content

Add timeout/retry to client config fetch; don't cache failures - #136

Open
sujen1412 wants to merge 1 commit into
developfrom
fix/config-fetch-retry-135
Open

sujen1412 wants to merge 1 commit into
developfrom
fix/config-fetch-retry-135

Conversation

@sujen1412

Copy link
Copy Markdown
Contributor

Fixes #135

Changes

  • _get_client_config now uses a requests.Session with urllib3.Retry (exponential backoff on connection errors and 502/503/504) and a (5, 30)s connect/read timeout.
  • Replaced @cache with a dict that stores only successful results. Failures raise a RuntimeError naming the config URL instead of returning None (which previously caused a cached failure and a later AttributeError).
  • Added tests: transient failure followed by success, permanent failure not cached, and success cached with timeout passed.

Notes

  • Existing tests in test_config_reader.py leak MAAP_API_HOST_SCHEME into the environment, which makes some URL tests order-dependent; the new tests use explicit https:// hosts to avoid that. I did not touch those.
  • Only the new tests plus URL tests were run locally (no network access to the hosted-API tests).

🤖 Generated with Claude Code

https://claude.ai/code/session_01DZUGQ3FvoiU3EkUrvAPTTQ


Generated by Claude Code

@sujen1412
sujen1412 changed the base branch from master to develop October 7, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_get_client_config has no timeout or retry, and failed fetches are cached

2 participants