Skip to content

fix(provisioning): limit shared Postgres connections, fail on unstable deploy - #20

Merged
roccoppp merged 1 commit into
masterfrom
roccoppp/fix-provisioning-api
Apr 2, 2026
Merged

roccoppp merged 1 commit into
masterfrom
roccoppp/fix-provisioning-api

Conversation

@roccoppp

@roccoppp roccoppp commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

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 text column to the Supabase organizations table.

Ticket Link

N/A

Checklist

  • Added or updated unit tests (required for all new features)
  • Has UI changes
  • read and understood our Contributing Guidelines

Device Information

N/A — backend-only changes

Screenshots

N/A

Release Note

Fixed shared Postgres connection exhaustion during org provisioning by limiting Mattermost connections to 10 open / 5 idle per instance. Provisioning now correctly reports failure when the deployed server never becomes stable.

…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>
@roccoppp
roccoppp merged commit eddc59c into master Apr 2, 2026
4 of 6 checks passed
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