Running a simple query like a select against a small table and I get results back; executing the same code using a more complex query and it errors out with a Task Canceled Exception.
var executeSqlRequest = service.Projects.Instances.Databases.Sessions.ExecuteStreamingSql(
new Google.Apis.Spanner.v1.Data.ExecuteSqlRequest()
{ Sql = sql_text, QueryMode= "NORMAL" },
session);
PartialResultSet resultSet = await executeSqlRequest.ExecuteAsync();
more info from debugging through the lib - looks like the socket was disposed while still in use and accessing it caused the task to be cancelled:
System.ObjectDisposedException occurred Message: Exception thrown: 'System.ObjectDisposedException' in System.dll Additional information: Cannot access a disposed object.
System.IO.IOException occurred Message: Exception thrown: 'System.IO.IOException' in System.dll Additional information: Unable to read data from the transport connection: Cannot access a disposed object. Object name: 'System.Net.Sockets.Socket'..
from client code debugging:
A task was canceled. { "ClassName": "System.Threading.Tasks.TaskCanceledException", "Message": "A task was canceled.", "Data": null, "InnerException": null, "HelpURL": null, "StackTraceString": " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Google.Apis.Requests.ClientServiceRequest
1.<ExecuteUnparsedAsync>d__30.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
1.d__27.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Google.Apis.Requests.ClientServiceRequest
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Google.Apis.Requests.ClientServiceRequest1.<ExecuteAsync>d__26.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
1.GetResult()\r\n at Discovery.ListAPIs.Program.d__10.MoveNext() in C:\Users\Dave\Documents\Visual Studio 2015\Projects\SpannerConsoleApp\SpannerConsoleApp\Program.cs:line 257", "RemoteStackTraceString": null, "RemoteStackIndex": 0,
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter
"ExceptionMethod": "8\nThrowForNonSuccess\nmscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\nSystem.Runtime.CompilerServices.TaskAwaiter\nVoid ThrowForNonSuccess(System.Threading.Tasks.Task)", "HResult": -2146233029, "Source": "mscorlib", "WatsonBuckets": null }---