Query connection timeout


#1

Trying to run the following query:

var query = bucket.CreateQuery("MyDoc", "by_asOf").Key(@"/Date(1440129600000-0400)/").ConnectionTimeout(100000);     
var results = bucket.Query<string>(query);

After about 20seconds the query returns with 0 results and StatusCode = ServiceUnavailable.
The Exception property reads “The operation has timed out”.

The StackTrace on the Exception shows StackTrace = " at System.Net.HttpWebRequest.GetResponse()\r\n at Couchbase.Views.ViewClient.Execute[T](IViewQuery query) in c:\Users\jmorris\repos\temp\couchbase-net-client\Src\Couchbase\Views\ViewClient.cs:line 92"

Does anyone know what timeout setting I need to update?
I also tried to increase the operationLifespan in my config file but still received the error.


#2

@becker -

There are two timeouts:

  1. One for the server API (which you set above)
  2. One for the client HTTP API - you can set this with ClientConfiguration.ViewRequestTimeout

In v2.1.4 and earlier this defaults to 5s and a max of 60s; in 2.2.0 (next month) the default changes to 75s with no limit.

-Jeff


#3

I tried to set my config in code using the following and I still timeout at exactly 20 seconds.

return new ClientConfiguration
     {
        Servers = new List<Uri>
        {
           new Uri("http://MyServer:8091/pools")
        },
        UseSsl = false,
        ViewRequestTimeout = 60000,
        BucketConfigs = new Dictionary<string, BucketConfiguration>
        {
           {
              "BucketName", new BucketConfiguration
              {
                 BucketName = "BucketName",
                 UseSsl = false,
                 Password = "",
                 DefaultOperationLifespan = 60000,
                 PoolConfiguration = new PoolConfiguration
                 {
                    MaxSize = 10,
                    MinSize = 5
                 }
              }
           }
        }
     };

Running version 2.1.1


#4

@becker -

It looks like a bug that was fixed in 2.1.3; I would suggest you update to 2.1.4 if possible.

-Jeff