Stage 12 runs exhaust the database session pooler's 15-client limit
维护者通常 1 天内回复
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 25/100
调研方向
Start at create_stage12_engine, which sets SQLAlchemy's QueuePool with pool_size=5 and max_overflow=5, and at runtime_store(), which builds a new engine per coordinator and worker call. Pull request #789 is already open against this work, so read it and its diff before starting anything. Done means a connection is held only for each short operation, refused connections are retried with bounded backoff, and a failed failure-record write no longer replaces the original error.
由索引模型根据 Issue 内容生成。
描述
Problem
Stage 12 coordinators and workers run out of database sessions. From 6 to 13 October 2026, 106 of the 153 production Stage 12 failures recorded:
FATAL: (EMAXCONNSESSION) max clients reached in session mode - max clients are limited to pool_size: 15
These were 100 US nationwide, 5 UK nationwide and 1 US state report. In 66 of them the coordinator failed at its initial claim, before any simulation started.
When the database is full, the failure handler's own write can also fail. The original error is then lost, and the comparison or simulation record stays running.
Cause
create_stage12_engineused SQLAlchemy's defaultQueuePoolwithpool_size=5andmax_overflow=5.runtime_store()builds a new engine for every coordinator and worker invocation.- A connection returned to
QueuePoolkeeps its physical session open. Each process therefore holds a pooler session while it calculates or waits, for up to 50 minutes. pool_recycle=300doesn't help, because recycling is only checked when a connection is checked out.- The coordinator and both country workers each allow 10 containers. Up to 30 processes can therefore each hold a session against a limit of 15.
Expected
- A database session is held only for each short operation.
- A connection refused before any statement is sent is retried, with a bounded backoff.
- A failure to write the failure record never replaces the original error.
Follow-ups (not in scope)
- Mark comparison and simulation rows that stay
runningpast the coordinator's 4,500 s timeout as failed. This needs a scheduled function. It would readSTAGE12_DATABASE_URL, which comes from Google Secret Manager and reaches Modal through thestage12-evaluation-runtimesecret. No workflow currently runs.github/scripts/stage12-sync-modal-secrets.sh, so how that Modal secret is populated is unconfirmed. - Consider the transaction-mode pooler if concurrent database operations still approach 15 after this change.
- 主要语言
- Python
- 星标
- 1
- 派生
- 1
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 51
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PolicyEngine/policyengine-sim-api 的其他 Issue
-
Update policyengine to 6.7.3可能已有人在做 @policyengine 于 1 天前认领。 未关闭
难度 2/5 半天 新手友好度 70/100
PolicyEngine/policyengine-sim-api#823 ·
维护者通常 1 天内回复
-
Integration tests fail due to missing UV virtual environment setup可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
PolicyEngine/policyengine-sim-api#314 ·
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 22/100
PolicyEngine/policyengine-sim-api#814 ·
维护者通常 1 天内回复
-
Register weighted-microdata rules: weights aren't values可能已有人在做 @anth-volk 于 4 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 30/100
PolicyEngine/policyengine-sim-api#806 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 25/100
PolicyEngine/policyengine-sim-api#805 ·
维护者通常 1 天内回复
查看 PolicyEngine/policyengine-sim-api 的全部 Issue
相似的 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 72/100
ianktoo/project-monitor#14 ·
-
security
难度 2/5 1-3 小时 新手友好度 84/100
btclib-org/btclib-wallet#478 ·
维护者通常 1 天内回复
-
security
难度 2/5 1-3 小时 新手友好度 75/100
btclib-org/btclib#2727 ·
维护者通常 1 天内回复
-
good first issue lead variant:container
难度 2/5 1-3 小时 新手友好度 76/100
radialmonster/orf-cleanroom#10 ·
维护者通常 1 天内回复
-
gdsa opencode: keep-alive cleanup trap fails with 'keepalive_pid: unbound variable'可能已有人在做 @darribas 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100