-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More robust listener close in
riverpgxv5
(#246)
As part of #239, we're observing the possibility of the notifier going into a hot loop where it's trying to reopen a listener connection, but the listener won't let it because it thinks the connection is already open. A suspect is the listener's `Close` implementation, which in the event of an error, returns the error and fails to release an underlying connection, putting it into a state where it's never reusable. Here, modify `Close` so that it always releases and unsets an underlying connection regardless of the error state returned. I tried to add a test case for this, but reading through pgx and net source code, I couldn't find any way to simulate an error from `Close` (I thought a cancelled context would do it, but it does not), so I had to leave it.
- Loading branch information
Showing
3 changed files
with
45 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
this was blowing our logs up previously... thanks for the fix @brandur