Add database connection retry with exponential backoff to billing subscription module #1364

Open
opened 2026-04-13 15:43:57 -04:00 by pook · 0 comments
Owner

In src/billing/subscription.ts (once PR #758 merges or on its branch), wrap database queries in retry logic for transient connection failures. Use exponential backoff: initial delay 200ms, max 3 retries, max delay 2s. Only retry on connection errors (ECONNRESET, ETIMEDOUT, connection refused), NOT on query errors (constraint violations, etc.). This prevents billing check failures during brief database hiccups — without it, a 1-second DB blip causes paying users to see 'no subscription' errors.


Generated by CEO Planner (priority: 3)

In src/billing/subscription.ts (once PR #758 merges or on its branch), wrap database queries in retry logic for transient connection failures. Use exponential backoff: initial delay 200ms, max 3 retries, max delay 2s. Only retry on connection errors (ECONNRESET, ETIMEDOUT, connection refused), NOT on query errors (constraint violations, etc.). This prevents billing check failures during brief database hiccups — without it, a 1-second DB blip causes paying users to see 'no subscription' errors. --- *Generated by CEO Planner (priority: 3)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#1364
No description provided.