Skip to content

Add DB retry/backoff and improve logging#37

Merged
scoop1120 merged 2 commits into
mainfrom
more-connection-fixes
Feb 18, 2026
Merged

Add DB retry/backoff and improve logging#37
scoop1120 merged 2 commits into
mainfrom
more-connection-fixes

Conversation

@scoop1120

Copy link
Copy Markdown
Contributor

Improve resilience and observability around DB access and GraphQL requests.

  • Add environment constants EXO_DB_RETRY_MAX, EXO_DB_RETRY_BASE_MS, EXO_DB_RETRY_MAX_MS.
  • Implement retry/backoff logic for read-only (SELECT) SQL operations with configurable max retries, base and max backoff, jitter, and detailed error logging for Postgres errors.
  • Add RetryConfig and helper functions to detect transient SQL errors and compute backoff.
  • Log and map transaction start failures to DatabaseError with tracing error context.
  • Warn and drop closed DB client in TransactionState before reacquiring.
  • Emit detailed error info when failing to acquire a pooled DB client (pool status + error) instead of silently propagating.
  • In GraphQL router: extract request ID from common headers, add it to Sentry scope, create a tracing span per request and log receipt.

These changes aim to handle transient DB connectivity issues more robustly and give better diagnostics for DB and request lifecycle failures.

Improve resilience and observability around DB access and GraphQL requests.

- Add environment constants EXO_DB_RETRY_MAX, EXO_DB_RETRY_BASE_MS, EXO_DB_RETRY_MAX_MS.
- Implement retry/backoff logic for read-only (SELECT) SQL operations with configurable max retries, base and max backoff, jitter, and detailed error logging for Postgres errors.
- Add RetryConfig and helper functions to detect transient SQL errors and compute backoff.
- Log and map transaction start failures to DatabaseError with tracing error context.
- Warn and drop closed DB client in TransactionState before reacquiring.
- Emit detailed error info when failing to acquire a pooled DB client (pool status + error) instead of silently propagating.
- In GraphQL router: extract request ID from common headers, add it to Sentry scope, create a tracing span per request and log receipt.

These changes aim to handle transient DB connectivity issues more robustly and give better diagnostics for DB and request lifecycle failures.
@github-actions

Copy link
Copy Markdown

Version bump detected: 0.30.10.30.2

@scoop1120 scoop1120 merged commit 195b479 into main Feb 18, 2026
7 checks passed
@scoop1120 scoop1120 deleted the more-connection-fixes branch February 18, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant