Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Retry/backoff + friendly error mapping for simulation entrypoint 429s; cache the versions map

オープン
#3,811 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
api, backend

調査の方向性

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):

  1. 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, honoring Retry-After when present) would have ridden out the burst edges instead of failing user reports instantly. Do NOT retry job submission unconditionally (double-spawn risk).
  2. 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PolicyEngine/policyengine-api のほかの issue

PolicyEngine/policyengine-api の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。