Stage 12 runs exhaust the database session pooler's 15-client limit
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 1
- Forks
- 1
- Merge medio
- 1 d 11 h
- PR fusionados (30 d)
- 50
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PolicyEngine/policyengine-sim-api
-
Integration tests fail due to missing UV virtual environment setupPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
PolicyEngine/policyengine-sim-api#314 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
PolicyEngine/policyengine-sim-api#814 ·
Los mantenedores suelen responder en 1 día
-
Register weighted-microdata rules: weights aren't valuesPosiblemente ocupada @anth-volk la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
PolicyEngine/policyengine-sim-api#806 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
PolicyEngine/policyengine-sim-api#805 ·
Los mantenedores suelen responder en 1 día
-
Refactor within ruff's complexity limits, then select every ruff rule (ALL)Posiblemente ocupada @anth-volk la tomó hace 2 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
PolicyEngine/policyengine-sim-api#803 ·
Los mantenedores suelen responder en 1 día
Todos los issues de PolicyEngine/policyengine-sim-api
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
UKGovernmentBEIS/control-arena#917 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
debpalash/VoiceStudio#2937 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
aws-samples/sample-per-model-bedrock#261 ·
Los mantenedores suelen responder en 1 día