Repository navigation
fix(provisioning): limit shared Postgres connections, fail on unstable deploy - #20
Merged
Merged
Conversation
…able deploy Each Mattermost instance defaults to 300 open Postgres connections, quickly exhausting a shared Postgres server and causing crash-loops and provisioning failures. Cap at 10 open / 5 idle per org. Also throw when a deployed server never becomes stable instead of silently marking the org as ready, and persist the error message to Supabase so the frontend can display it. Co-Authored-By: Claude Opus 4.6 <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
Fixes shared Postgres connection exhaustion that caused provisioning failures and infinite loading spinners. Mattermost defaults to 300 open connections per instance, which quickly exhausts the shared Postgres limit (~100). This caps each org at 10 open / 5 idle connections. Also changes
setupOLI()to throw when the server never stabilizes (instead of silently marking as ready), and persists the error message to Supabase so the frontend can display it.Note: Requires adding a
provision_error textcolumn to the Supabaseorganizationstable.Ticket Link
N/A
Checklist
Device Information
N/A — backend-only changes
Screenshots
N/A
Release Note