You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add transient-DB resilience (EnableRetryOnFailure) on the request path #269
Deployment-readiness gap (#244), RECOMMENDED — flagged by 2 of 3 reviewers.
Problem
The HTTP request path has no resilience to transient DB failures. UseNpgsql is configured with no execution strategy — EnableRetryOnFailure appears nowhere (PostgresDbContextConfigurator.cs). The background worker was hardened against transient outages in #65 (DurableJobWorker.cs:41-71), but a request that hits a managed-Postgres restart/failover or a dropped pooled connection throws straight to a 500. /error only maps concurrency/serialization codes (Program.cs:751-772), not transient connection loss.
Fix
Enable a bounded Npgsql retry strategy (NpgsqlRetryingExecutionStrategy via EnableRetryOnFailure). Note the interaction: a retrying strategy disallows user-initiated transactions, so the export's explicit RepeatableRead transaction paths must move to dbContext.Database.CreateExecutionStrategy().ExecuteAsync(...). Use the existing idempotency keys to keep ambiguous commit/retry safe.
Verify
Kill the DB mid-request on a dev instance — observe the request retry and succeed (or fail cleanly) instead of an unhandled 500; the export transaction still runs under the strategy.
Part of the #244 deployment-readiness audit; tracked in epic #15.
changed the title [-]Deploy: add transient-DB resilience (EnableRetryOnFailure) on the request path[/-][+]Add transient-DB resilience (EnableRetryOnFailure) on the request path[/+]on Jul 30, 2026
Activity
[-]Deploy: add transient-DB resilience (EnableRetryOnFailure) on the request path[/-][+]Add transient-DB resilience (EnableRetryOnFailure) on the request path[/+]fix(infra): never replay an owned transaction — it is not replayable (#…
fix(api): stop retrying next(context); replay a lost commit ack inste…
test(api): pin the retry boundary from both sides (#269)
fix(api): hold the bootstrap advisory lock across the reads, not just…
fix(api): prove the bootstrap lock inside the create transaction (#269)
fix(api): keep each failed-access increment single-attempt (#269)
fix(api): recover the ambiguous commit on every auth-token save (#269)
feat(api): bounded retry-on-failure for transient DB connection loss (#…
Merge branch 'main' into chore/245-squash-migrations
spec: design user disable/enable and email change (#356, #357) (#358)