Retry/backoff + friendly error mapping for simulation entrypoint 429s; cache the versions map
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
policyengine_api/libs/simulation_entrypoint.py から始め、resolve_app_name とジョブのポーリングを追跡してから、周辺の economy service を調べます。リトライとマッピングの境界を定義する前に、control plane の GET 失敗と送信エラーがどのようにクライアントへ到達するかを確認します。完了条件は、Retry-After をサポートする 429/503 の有界なリトライ、分かりやすいリトライ可能エラー、短い TTL の versions-map キャッシュがあり、ジョブ送信を無条件にリトライしないことです。
索引モデルが issue の本文から書いたものです。
説明
During the 2026-09-01 simulation-entrypoint outage (PolicyEngine/policyengine-sim-api#674), the v1 API turned an upstream 429 Too Many Requests into a raw 500 shown verbatim in app-v2:
Society-wide calculation failed (500): {"status": "error", "message": "Client error '429 Too Many Requests' for url 'https://simulation.api.policyengine.org/versions/policyengine'\nFor more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429", "result": null}
Two hardenings in policyengine_api/libs/simulation_entrypoint.py (and the economy service around it):
- Bounded retry with backoff on 429/503 for the cheap control-plane calls —
resolve_app_name(GET /versions/policyengine,GET /versions/{country}) and job polling. These are tiny idempotent GETs; a 3-attempt exponential backoff (~0.5s/2s/8s, honoringRetry-Afterwhen present) would have ridden out the burst edges instead of failing user reports instantly. Do NOT retry job submission unconditionally (double-spawn risk). - Error mapping: upstream 429/5xx should surface as a retryable "computing infrastructure is busy, try again shortly" status/message to clients, not an httpx exception string with an MDN link. The raw string ends up rendered in the app's report error card.
A versions-map cache (short TTL, e.g. 60s) in the v1 API would also remove the /versions/policyengine round-trip from the critical path of every economy calculation — it changes only on sim-api deploys.
- 主要言語
- Python
- スター
- 18
- フォーク
- 33
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 23
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PolicyEngine/policyengine-api のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
PolicyEngine/policyengine-api#3823 ·
メンテナーはふだん 2 日以内に返信
-
API v2: report validations as an append-only, provenance-keyed resource on reports対応中かも @anth-volk が 22 日前に担当しました。 オープン
PolicyEngine/policyengine-api#3818 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
PolicyEngine/policyengine-api#3816 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
PolicyEngine/policyengine-api#3814 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
PolicyEngine/policyengine-api#3802 ·
メンテナーはふだん 2 日以内に返信
PolicyEngine/policyengine-api の issue をすべて見る
似ている issue
-
namespace operations
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
EclipseFdn/open-vsx.org#13573 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
collective/icalendar#1854 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
rancher/rancher-ai-agent#412 ·
メンテナーはふだん 6 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
TUDelftGeodesy/DePSI#134 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
HenriquesLab/rxiv-maker#335 ·