Repository navigation
fix(connection): say which server failed, and what ran out - #528
Merged
Merged
Conversation
Both of these are one fault wearing two hats: the app knew something had gone
wrong and did not pass it on.
Auto-reconnect at startup ended in `catch {}`. A server that was down left its
tabs looking entirely normal, and the user found out at the next query, via
"Connection not found" — which names neither the server nor the moment it
happened. The failures are now collected and reported by name, with what to do
about it. Leaving the tab without a live connection was already the right
behaviour and is unchanged.
Pool exhaustion surfaced as sqlx's "pool timed out while waiting for an open
connection". That is true and useless: it names neither the pool, nor the
limit that was hit, nor anything the user could change. The message now names
the profile, its max pool size, how long it waited, and the two things that
actually cause it — something long-running holding the connections, or a
limit set too low for how the connection is used. Applied both at connect and
at query time, since the second is where it will usually bite.
Only the pool-timeout case is rewritten; every other driver error keeps its
own message, which is nearly always more specific than anything we could
substitute.
Neither issue is fully closed by this, and deliberately so. #276 also asks for
a HealthChecker that notices a server going away and reconnects on a backoff,
and #279 for live pool statistics in the status bar. Both are features rather
than defects, and are left for the feature pass.
Refs #276, #279
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.
Refs #276, #279. Both are one fault wearing two hats: the app knew something had gone wrong and didn't pass it on.
Silent startup reconnect (#276)
Auto-reconnect ended in
catch {}:Leaving the tab without a connection is right. Saying nothing isn't — the tab looked entirely normal, and the user found out at the next query via
Connection not found, which names neither the server nor when it happened. Failures are now collected and reported by name, with what to do about it.Opaque pool exhaustion (#279)
sqlx reports
pool timed out while waiting for an open connection. True and useless: it names neither the pool, the limit that was hit, nor anything the user could change.The message now names the profile, its max pool size, how long it waited, and the two things that actually cause it — something long-running holding the connections, or a limit too low for how the connection is used. Applied at connect and at query time, since the second is where it will usually bite.
Only the pool-timeout case is rewritten. Every other driver error keeps its own message, which is nearly always more specific than anything we'd substitute — there's a test pinning that.
What this deliberately does not do
Neither issue is fully closed:
HealthChecker) #276 also asks for aHealthCheckerthat notices a server going away and reconnects on a backoff, with the tab turning yellow.pool_max=5default) surfaces opaquely; no UI for live pool stats (FR-1.2.3) #279 also asks for live pool statistics (idle/in_use/max) in the status bar.Both are features rather than defects, so they're left for the feature pass. I'll note that on the issues rather than closing them.
Verification
The reconnect test was run against the unfixed code and fails there.
While fixing
ConnectionTabs.test.tsxI found its store mock had nosetState/getState, so the component's calls hit the real store — a continuation of the wrong-mock-path problem from #526. The mock now provides both.1657 frontend tests, 79 unit, 63 integration. clippy/tsc/dprint clean.
Unrelated: the test containers had stopped (host restart), which briefly showed as 6 integration failures.
just db-upand they're green — which is the#[ignore]split from #516 working as intended.🤖 Generated with Claude Code