Repository navigation
* Fixed an issue where reads in NpgsqlConnector.Open were never timin… - #3226
russellfoster wants to merge 1 commit into
Conversation
|
This version is pretty outdated, so not supported anymore. Try to update to 4.1.5 or wait a bit more for 5.0.0 which will support socket level timeouts. |
|
It occurs in 4.1.6 as well. |
|
@vonzshik, @roji may you take a look at this issue? The fix can be used for 4.1.6 as well, but I don't remember all nuances. @russellfoster you may be interested in trying unreleased 5.0.0 which we are working on. It has the feature you want as other cancellation related things too. |
|
Ok, will do. Thanks! |
|
Well, it should be enough just to set timeouts for buffers after they're created here: npgsql/src/Npgsql/NpgsqlConnector.cs Lines 593 to 594 in bd5dea8 And also set the connector's UserTimeout.
|
|
But yeah, both 5.0 and 4.1.6 should have this problem. |
roji
left a comment
There was a problem hiding this comment.
@russellfoster thanks for reporting this.
First, this PR includes a lot of unrelated indentation/whitespace changes - please revert those.
Second, I agree with @vonzshik's comment that it should be enough to just set the timeout as usual once the buffers are created - this is a simpler approach and more in-line with how things are done in the driver (in older versions this means setting NpgsqlConnector.ReceiveTimeout, in 5.0 it's setting timeout on the buffers themselves which manage the timeouts).
For 5.0 (main), we also need a regression test for this, using the new PostgreSQL mocking infrastructure. As this is new and not trivial, I'll take care of it.
Finally, we usually apply fixes to main (5.0) first, and then backport to older versions. I'd suggest starting a new PR against main, and I can take care of backporting later. Does that sound good?
|
Note: I've opened #3227 as a tracking issue for this. |
|
Superceded by #3229 |
Hello, I fixed an issue that I ran into:
In this situation, Npgsql will hang on Connection.Open(). I tried this with the latest (4.6.1), and it occurs there as well. The patch I have is for 3.2.7. Here is the related stack trace, the last op being where it was hung:
One thing I noticed is there are no write timeouts. I guess this is by design? I did not see it hang on writes, but wanted to cover all the bases to make sure we don't see this in the field somewhere.