Skip to content

[P1][bug] Pool exhaustion (per-profile pool_max=5 default) surfaces opaquely; no UI for live pool stats (FR-1.2.3) #279

Closed

Description

@EVWorth

Context

DESIGN_REQUIREMENTS §FR-1.2.3: "Configurable pool size (default: 5, max: 50) per connection profile… pool statistics visible in status bar".

Problem

UI hard-caps pool at 5 (no 50 ceiling). With 11 active profiles at pool_max=5, the 11th connect triggers acquire_timeout, surfacing as Failed to connect: pool timed out while waiting for an open connection — opaque. No UI for live pool stats; pool statistics visible in status bar is unmet.

Files

  • src-tauri/crates/mas-core/src/connection/manager.rs:60-77
  • src/components/connection/ConnectionDialog.tsx:34-35, 487-499
  • src/components/layout/StatusBar.tsx (no pool stats surface)

Repro

Connect 11 profiles with pool_max=5 against a MySQL with max_connections=100. The 11th connect returns generic pool-timeout error.

Expected

The 11th returns a clear error referencing pool capacity, and StatusBar shows live idle/in_use/max per connection on hover.

Proposed fix

Scope M. Add ConnectionManager::pool_stats() returning [(connection_id, {in_use, idle, max})]. Expose via get_pool_stats Tauri command. Render hover tooltip in StatusBar.tsx. Optionally add a global ceiling in connect.

Acceptance

Live pool stats render in StatusBar; 11th connect error mentions pool capacity by name.

Needs human verify

Yes.

Activity

  1. added
    audit
    severity/p1
    kind/bug
    kind/doc-drift
    area/connection
    on Jul 24, 2026
  2. EVWorth commented on Sep 12, 2026

    @EVWorth
    OwnerAuthor

    Done in #660, in three parts.

    The opaque error was fixed earlier: a pool timeout now names the profile, its limit, the wait, and what to change — instead of sqlx's "pool timed out while waiting for an open connection", which names none of them.

    Pool statistics in the status bar — the part of FR-1.2.3 that was simply missing. It shows pool 3/5, turning amber when nothing is free, with a title saying what that means for the next query. Polled every three seconds rather than pushed: it changes with every query and nobody needs to know within the second.

    The 50 ceiling you noticed was missing — and the fields turned out to take anything at all:

    max of 0 sqlx panics
    min above max sqlx refuses to build the pool, so the connection fails later with nothing pointing here
    max of 5000 five thousand server threads for one profile

    The dialog now says why, beside the field, with a disabled Save. The backend clamps to 1–50 as well and logs when it does, so a profile stored by an older build still connects rather than failing at a number nobody can see.

    One thing not done: your repro's eleventh connection. With eleven profiles at pool_max=5 against a server allowing 100, the limit that binds is the server's max_connections, not any pool's — so the honest message there is about the server, and it is the server's own error, which we pass through. The per-pool message covers the case the profile's own limit causes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/connectionauditkind/bugkind/doc-driftseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions