Closed mjl- closed 2 years ago
looks like this is also failing tests
The failed error was due to existing checks around "context canceled" not handling the error. Those places still check for driver.ErrBadConn. I'll look into if I can remove those errors there.
I'll also look into your other cleanup suggestions. Hopefully within the next few days.
For https://github.com/lib/pq/issues/1062
Instead of just whether the connection is ErrBadConn. Often times, the error will still be ErrBadConn. But for expired/cancelled contexts, it will be the error for the context. Most functions still return ErrBadConn per the database/sql/driver contract ("ErrBadConn should only be returned from [...] a query method"). For rows.Next() we return the context-related error.
The database/sql/driver contract doesn't look very precise. Is Next a "query method" and should database/sql handle ErrBadConns when Next returns them?
Do we have more functions that should return the canceled-context error message?