-
-
Notifications
You must be signed in to change notification settings - Fork 972
Open
Description
Hi, thanks for maintaining pgx! I was testing some Go code that was reliant on pgxpool with Antithesis, and ran into the following error:
pgxpool: detected infinite loop acquiring connection; likely bug in PrepareConn or BeforeAcquire hook
This was confusing, because I hadn't set a PrepareConn / BeforeAcquire hook, but I went through the code and found this:
Lines 630 to 634 in 4c1308c
| err := cr.conn.Ping(pingCtx) | |
| if err != nil { | |
| res.Destroy() | |
| continue | |
| } |
It seems that in the event of a network error, if all pings to Postgres fail, pgxpool throws a detected infinite loop error. Could the error message here be improved somehow - and would it be possible to use a sentinel error that can be caught and handled?
Metadata
Metadata
Assignees
Labels
No labels