Repository navigation
fix(errors): pool exhaustion, lost sessions and TLS failures read as what they are (#1316) - #1328
Merged
Merged
Conversation
…what they are (#1316) - A full pool is a PoolExhaustedException (the session count and what to do), not Bad state: ... - Connection reset / broken pipe / terminating connection / server gone away on an established session is ConnectionLostException with a reconnect hint, not did not accept the connection. - HandshakeException and certificate / TLS-version failures are TlsFailureException pointing at the SSL mode and root certificate.
3 tasks
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.
Closes #1316
Problem
StateError('... connection pool exhausted: 32 slots in use.')and it reached the user asBad state: PostgreSQL connection pool exhausted....SocketExceptionwasHostUnreachableException(did not accept the connection), including Connection reset by peer and Broken pipe on a session that had been working.HandshakeException,CERTIFICATE_VERIFY_FAILED, unknown ca, wrong version number and the like were unmapped: the raw text, with no hint about the SSL mode or the root certificate.Fix (
database_error_mapper.dart,querya_database_exception.dart, the three pools)PoolExhaustedException: The PostgreSQL connection pool is full: 32 sessions are in use. Close tabs or connections you no longer use, then try again (also MySQL, SQLite).ConnectionLostExceptionfor reset / broken pipe / closed connection / terminating connection / server has gone away / lost connection, with a reconnect hint. Checked before the refused-connection mapping.TlsFailureExceptionforTlsExceptionand certificate / handshake / protocol-version texts, pointing at the SSL mode and the root certificate (and at turning SSL off for a server without TLS).Tests: mapper — five wordings of a lost session (none is a refusal), a refused connection is still unreachable, three TLS failures with the hint, an authentication failure is not TLS; pools — a full PostgreSQL / SQLite / MySQL pool throws the typed exception whose text names the engine, has the hint and no
Bad state(the MySQL test that expectedStateErrorwas updated).