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 }}
Repository navigation
Break the connection when sync cancellation fails #3187
With our new cancellation logic, when the user triggers a cancellation token (or CommandTimeout is reached), we attempt a PG cancellation. In async, if the PG cancellation itself fails (e.g. failure to connect because of a network partition), we immediately break the (main command's) connection.
We should look into doing the same for sync cancellation. We can't trigger a cancellation token, but IIRC it's OK to forcibly close the socket - this should immediately terminate any I/O operation stuck on that socket. This of course needs testing - and I'm not sure which exception gets thrown on the read side - but it would align sync and async behavior and is generally useful.
You're right, this is another instance of some concurrent/unrelated thing that suddenly breaks the connector as reading is taking place. Good to note this scenario in #1323 as well.
This of course needs testing - and I'm not sure which exception gets thrown on the read side - but it would align sync and async behavior and is generally useful.
Just checked for for .net core 3.1 - we get IOException with a message "A blocking operation was interrupted by a call to WSACancelBlockingCall.", and with an inner exception SocketException with the same message.
Activity
vonzshik commentedon Sep 25, 2020
As of right now, it does seem reasonable for me. But there would be the same problem we've discussed at #1323.
roji commentedon Sep 25, 2020
You're right, this is another instance of some concurrent/unrelated thing that suddenly breaks the connector as reading is taking place. Good to note this scenario in #1323 as well.
vonzshik commentedon Sep 27, 2020
Just checked for for .net core 3.1 - we get
IOExceptionwith a message "A blocking operation was interrupted by a call to WSACancelBlockingCall.", and with an inner exceptionSocketExceptionwith the same message.roji commentedon Oct 25, 2020
@vonzshik this is done, right?
vonzshik commentedon Oct 26, 2020
@roji nope, not yet.
roji commentedon Nov 13, 2020
@vonzshik I propose we leave this for 6.0 - we will have cancellation-related leftovers in any way, does that sound OK?
vonzshik commentedon Nov 13, 2020
ok