You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Make an exception for a timeout of a sync query the same way as for an async one #3132
Right now, if ReadBuffer fails with a timeout for a sync query, we get NpgsqlException with an inner exception as IOException with another inner exception as SocketException. And after that, you have to check SocketErrorCode of SocketException on a correct code (and don't forget about bug in Mono, where it throws SocketException with the wrong error).
I think it's reasonable to throw NpgsqlException with an inner exception as TimeoutException, and inside of TimeoutException have IOException as inner exception. We already have the same behavior for async queries.
Activity
roji commentedon Sep 8, 2020
FWIW I wonder if the mono bug is still there, this may be a leftover from a long time ago (we don't run the tests on mono in CI)
vonzshik commentedon Sep 8, 2020
So you're saying we might have a bug with the timeouts for sync queries for the mono
roji commentedon Sep 9, 2020
Yeah, although it would affect only a pretty narrow scenario (timeout during synchronous NpgsqlConnection.Wait), opened #3135 to track.
This is making me think of this: #1330 (comment) 🤣
vonzshik commentedon Sep 9, 2020
It seems, it's still there and wouldn't be fixed.
roji commentedon Sep 13, 2020
@vonzshik that issue seems to discuss the text message in the exception, which is quite different from a bad SocketErrorCode...
In any case, the bug is still there - I've reproduced it and filed mono/mono#20381 to track.