Closed DavidSSL closed 4 years ago
Exact 5 mins sounds like a configuration issue rather than technical issue.
NpgsqlException is telling that it comes from drivers rather than SQLProvider itself. I know people have ran longer queries using SqlProvider, but maybe other databases.
Btw, your source code doesn't make so much sense, it takes 1 000 000 and then only one, by Seq.head. But that's probably just to demonstrate the issue, I suppose.
Hi Thorium,
You are absolutely right in saying that my example is non-sensical as I am experimenting with SQLProvider and I let that slip through.
However the fact is that from a high level point of view I have an API provided to me using which I pass a timeout value.
SQL.GetDataContext(TimeSpan.FromMinutes(20.0).Minutes)
I would not expect to have to know anything about what Npgsql is doing underneath but I would expect that the timeout value would just be patched through.
Am I wrong in this aspect?
Yes you are correct, but to fix the issue we have to know what timeout is being hit, to modify the timeout-setting to configure it.
@Thorium thank your answer. After further testing, I cannot reproduce the problem anymore. In fact, I can validate that things works as they should.
What I mean by this is that I ran the same operation with 5 minutes as the command timeout and it did in fact time out after 4 minutes.
Then I increased the command timeout to 15 minutes and this time it returned the result after 9 minutes.
Two differences this time though:
Description
When using SQLProvider my dB connection is timing out despite setting the command time out sufficiently high.
Repro steps
From a table containing 55 million entries, I try to retrieve the first 1 million using the following (apologies about formatting ):
There is nothing wrong with the query because it ran fine with take 1000
Expected behavior
I expect the query to run to the end without problems because from the query generated by
Common.QueryEvents.SqlQueryEvent |> Event.add (printfn "Executing SQL: %O")
which I ran, it took less than 8 mins to complete and my timeout is set to 20 mins.
Actual behavior
Not that I timed it precisely but the connection timed out within 5 mins with
Known workarounds
Related information