Skip to content

fix: consolidate solana-relay Knex connection pools#14309

Merged
dylanjeffers merged 1 commit into
mainfrom
fix/solana-relay-knex-pool-fix-2
May 14, 2026
Merged

fix: consolidate solana-relay Knex connection pools#14309
dylanjeffers merged 1 commit into
mainfrom
fix/solana-relay-knex-pool-fix-2

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Problem

The solana-relay service had 8 route/middleware files each calling initializeDiscoveryDb() at module scope, creating 8 independent Knex connection pools. Each pool defaults to max 10 connections, so up to 80 connections could be open simultaneously, exhausting Postgres under load.

This caused: Knex: Timeout acquiring a connection. The pool is probably full.

Fix

Extracted a single shared Knex singleton at src/db.ts and updated all 8 callers to import from it.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 13, 2026

⚠️ No Changeset found

Latest commit: e7a96ea

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dylanjeffers dylanjeffers merged commit 8e43ac1 into main May 14, 2026
3 checks passed
@dylanjeffers dylanjeffers deleted the fix/solana-relay-knex-pool-fix-2 branch May 14, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant