Skip to content

Commit b4041af

Browse files
authored
docs: ADR 0012 matches db-retry 0.8.1, require db-retry>=0.8.1 (#59)
1 parent 5ef1ee2 commit b4041af

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

‎docs/adr/0012-pool-pre-ping-off.md‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ its first statement, SQLAlchemy marks the error `connection_invalidated`, and
66
rejected because it adds a BEGIN, a ping and a ROLLBACK to every checkout, and a
77
request makes two checkouts. Measured on `GET /api/auth/me/` and the message
88
list, it cost 7 to 35% of throughput on a local network and 40 to 57% with 1 ms
9-
of database latency. The price of the retry is a rule the code must keep: every
10-
query a retried use case runs goes inside its `Transaction` block, because a
11-
query outside it leaves the session in a dead transaction that the retry cannot
12-
roll back. `tests/use_cases/test_connection_loss.py` kills a connection both
13-
while it is idle in the pool and while a session holds it.
9+
of database latency. The retry needs one rule: every query a retried use case
10+
runs goes inside its `Transaction` block. Entering `Transaction` rolls back a
11+
session whose connection was lost, so a query after the block is recovered, but
12+
a query before it still fails the retry.
13+
`tests/use_cases/test_connection_loss.py` kills a connection both while it is
14+
idle in the pool and while a session holds it.

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies = [
1414
"pydantic-settings",
1515
"granian[uvloop]",
1616
"argon2-cffi",
17-
"db-retry>=0.8.0",
17+
"db-retry>=0.8.1",
1818
# database
1919
"alembic",
2020
"alembic-postgresql-enum",

‎uv.lock‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)