Repository navigation
Include pool label in closed connection errors - #363
Open
agustin2606 wants to merge 1 commit into
Open
agustin2606 wants to merge 1 commit into
agustin2606 wants to merge 1 commit into
Conversation
Member
|
@nathanl did we discuss this before as well? The concern with this approach is additional data copying into the holder on every operation. I wonder if this could be lifted from the process instead (or not because the process may be dead). |
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.
Fixes #346
When a pool is started with
:label(as ecto_sql does with the repo name since elixir-ecto/ecto_sql#698), the "connection is closed" error now says which pool it came from.Problem
With several repos, an ownership timeout in tests surfaces as an error that doesn't say which repo it belongs to.
Cause
The error is built in the caller by
DBConnection.Holderafter the ownership proxy has stopped and its holder table is gone, so there is no live process left whose label could be read (the approach #332 used forOwnershipError).Fix
:labelin the holder'sconnrecord when it checks in.Holder.checkoutalready reads that record, so it copies the label into thepool_ref. The ownership proxy passes the label of the connection it checked out on to its own holder.[inspect(label)]prefix, written withinspectlike the label in the ownership error (Ownership.Manager).:labelthe message is unchanged. No process labels are involved, so it works on every supported OTP version.Testing
label: TestRepo: the error message is prefixed with[TestRepo].