Model/applications/modelling_e2e
Jun-te Kim fb308cfaea Use NullPool as a graceful ceiling for the one-connection-per-lambda design
The invocation is architecturally one DB connection at a time (read up front,
sequential write Units of Work, overrides resolved on the unit's own session).
Keep that as the design intent, but back it with NullPool instead of a fixed
pool_size=1 pool: each checkout opens a fresh connection and closes it on return,
so there is no pool slot to exhaust.

The difference is the failure mode if a path ever regresses and holds two
Sessions at once. A pool_size=1/max_overflow=0 pool turns that into a hard
30s dead-lock that fails the whole invocation ("QueuePool limit of size 1
overflow 0 reached, connection timed out"). NullPool instead opens a transient
second connection for that instant and the Lambda keeps running. The design
target stays one connection; NullPool just keeps it alive if we slip.

The single-connection invariant itself is still enforced in the Unit of Work
(overrides read on the unit's own session) and pinned by the regression test,
which uses its own strict pool_size=1 engine so it asserts the architecture
regardless of the production NullPool choice.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 17:10:23 +00:00
..
local_handler remove smoke tests from gh workflows 2026-06-24 11:35:30 +00:00
Dockerfile move handler stuff to applications directory 2026-06-22 13:35:23 +00:00
errors.py Fail unmodellable properties with a specific, debuggable error 🟥 2026-06-24 14:10:55 +00:00
handler.py Use NullPool as a graceful ceiling for the one-connection-per-lambda design 2026-06-24 17:10:23 +00:00
modelling_e2e_trigger_body.py process multiple properties in one message 2026-06-22 15:46:18 +00:00
requirements.txt various fixes 2026-06-22 14:21:52 +00:00