_logger.LogInformation("Fetch data ...");
var statement = "SELECT ...";
var bucket = await _bucketProvider.GetBucketAsync().ConfigureAwait(false);
var result = await bucket.Cluster.QueryAsync<MyObject>(statement,
options => options
.ScanConsistency(QueryScanConsistency.RequestPlus)
.AdHoc(false)
.Metrics(true)
.Readonly(true)).ConfigureAwait(false);
// DOES NOT GET PRINTED
_logger.LogInformation("Unreachable");
When the code executes the first log line is printed and after that nothing happens. It seems like the query timeout does not work properly.
The problem occurs after around 2 hours when running in a Docker Container with a memory limit of 500Mb.
Can someone please help me to identify the Problem.
The default query timeout is 75 seconds, so even if your builder query timeout of 15 seconds wasn’t working, the query would timeout in 75 seconds. You could try executing the query “SELECT 1” just to test the flow of your app.
I’ve reviewed the code and I don’t see any problem that would cause your symptoms at a glance. It does appear that it could take a bit longer than the timeout if there are retries, but no more than 2x the configured timeout if a retry were to start immediately before the 15 second timeout was reached.
That said, I could easily be missing some subtle corner case. The SDK includes SourceLink, so if you disable Just My Code in Visual Studio you should be able to step through the SDK source and perhaps find where it’s hanging?