fix: consolidate solana-relay Knex connection pools#14308
Open
dylanjeffers wants to merge 3 commits into
Open
Conversation
Instruments three key contest interactions following the existing
'Remix Contest:' event prefix and {remixContestId, trackId} property
shape used by the host/pick-winners events:
- REMIX_CONTEST_VIEW: contest page/screen first resolves trackId+eventId
- REMIX_CONTEST_ENTER: user taps Enter Contest / Upload Remix
- REMIX_CONTEST_VIEW_SUBMISSIONS: user opens the submissions tab
Mobile submissions-tab firing uses useFocusedTab from
react-native-collapsible-tab-view because the contest tabs mount
eagerly (lazy: false) — a plain mount effect would fire even for
users who only view the Details tab.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…t sections Bug 1 (web): Align static explore section visibility with SearchResults render condition — hide sections when inputValue is set (during debounce window) in addition to when showSearchResults is true, so Premium and other filters applied via the filter pills always suppress unfiltered curated sections. Bug 2 (web): Guard empty-state tile behind !isPending in AlbumResultsPage and PlaylistResultsPage so the NoResultsTile is not shown while the query is still in its initial loading phase, preventing a spurious empty-state flash when combining "Downloads Available" + "Electronic" genre filters. Bug 3 (mobile): Include category !== 'all' in the showSearch guard on the explore screen so tapping a content-type pill (Tracks, Albums, etc.) immediately shows the filtered SearchResults without requiring a second filter to be added. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tion Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidate the solana-relay service's Knex connection pools into a single shared singleton to prevent Postgres connection exhaustion under load.
Root Cause
The solana-relay service had 9 separate route/middleware files each calling
initializeDiscoveryDb(config.discoveryDbConnectionString)at module scope. Each call creates an independent Knex pool with a default max of 10 connections, allowing up to ~90 connections to be open simultaneously from a single service instance. Under load this exhausts the Postgres connection limit and causes downstream failures.Fix
src/db.tsthat exports a single shared Knex instance built from the same connection string.dbfrom the shared singleton instead of creating their own pool:src/routes/meteora/swap_coin.tssrc/routes/meteora/swap_coin_quote.tssrc/routes/launchpad/claim_fees.tssrc/routes/launchpad/claim_vested_coins.tssrc/routes/launchpad/getKeypair.tssrc/routes/relay/getAllowedMints.tssrc/routes/relay/associateExternalWallet.tssrc/middleware/signerRecovery.tsAfter this change the service holds a single pool (max ~10 connections by default) regardless of how many route modules use the database.
Test plan
npx tsc --noEmitinpackages/discovery-provider/plugins/pedalboard/apps/solana-relaysucceeds (no new errors introduced)🤖 Generated with Claude Code