Repository navigation
Conversation
roji
left a comment
There was a problem hiding this comment.
Looks good.
In addition to the comments below, as long as we're working here, let's do a bit more cleanup:
dontBreakOnTimeoutsis only set to true when waiting for PG notifications via NpgsqlConnector.{Wait,WaitAsync}. There is no real reason for the exception to be TimeoutException in that case, rather than TimeoutException wrapped by NpgsqlException - we can modify the catch there to identify whatever timeout exception we throw here. The only difference between the two branches should be that whendontBreakOnTimeoutsis true, we don't break (as the flag name implies).- Once this is done, the sync path (catch IOException) and async path (catch OperationCanceledException) are identical - we can unify them under the catch below and switch on the exception type to de-duplicate the logic once.
|
@roji done! Also, something curious I've been able to find: while |
This is because until very recently we didn't have async timeouts at all - you added these in #607 :) But you're right - we also need to complete async timeout support for WaitAsync. This would probably mean introducing a new overload which accepts the timeout (just like with sync Wait), and make sure to flow it down just like NpgsqlCommand does. It's a good idea to open a new issue to track this - you're of course welcome to work on it. |
|
@roji done again! 😃 |
Closes #3132