.Using .net SDK 3.1.1
A call with default options
await cluster.QueryAsync<T>(query);
throws “Timeout 1m15s exceeded [1080]”
The same call with pre-set timeout
var qOptions = new QueryOptions();
qOptions.Timeout(TimeSpan.FromMinutes(10));
var queryResult = await cluster.QueryAsync<T>(query, qOptions);
throws “The query was timed out via the Token.” in the same 1m 15s
Motivation is to let some but only few long running queries.
@jmorris
I suspect the issue is the underlying HttpClient.Timeout, which defaults to 100 seconds. I suspect it’s effectively taking the lesser of the two timeouts.
As to the precise error returned, that is the error returned when the HttpClient throws an OperationCanceledException. couchbase-net-client/src/Couchbase/Query/QueryClient.cs at 02c9b864735aca4cec3a2527ab8482be0acebf73 · couchbase/couchbase-net-client · GitHub
Oddly, the behavior of HttpClient.Timeout varies by .NET runtime, but it can be a TaskCanceledException (which is derived from OperationCanceledException). See the “Remarks” section of HttpClient.SendAsync Method (System.Net.Http) | Microsoft Learn
Thank you for your response. Does it mean there is no way to configure any timeout ( Client Settings for the .NET SDK | Couchbase Docs ) exceeding 100s by means of .net SDK? And no workaround possible
@skaryshev I’d wait for @jmorris to confirm, but at first glance it looks like a bug that needs to be fixed.
Unfortunately, the only workaround I see right now is very, very hacky and involves a lot of reflection of SDK internals and dynamic proxy generation. It would also be pretty difficult to implement. I wouldn’t recommend it unless you absolutely can’t wait for a bug fix. Let me know if you want some guidance on it, though.
@skaryshev
I am pretty sure its a bug as the default timeout in the SDK happens 1m 15s. It looks like there is some confusion as to the token being used in the retry mechanism and the token used by the internal QueryClient
. I created a Jira ticket for tracking. Thanks for reporting!
Jeff