Google.Apis.Sheets.v4.SheetsService Execute freezes application in dotnet Mono

我只是一个虾纸丫 提交于 2020-01-06 04:41:26

问题


I've been using the GoogleSheets API from a C# application in windows without problem for quite a while.

When I port this program to Linux, and run using Mono, it freezes regularly at "Execute" for Spreadsheets.Get OR BatchUpdate.

  SheetsService service = new SheetsService(new BaseClientService.Initializer()
        {
            HttpClientInitializer = credential,
            ApplicationName = ApplicationName,
        });
  var gotSS = service.Spreadsheets.Get(spreadsheetId);   // <<< freezes HERE
...
  var vbur = service.Spreadsheets.Values.BatchUpdate(buvr, spreadsheetId);  // <<< OR freezes HERE

It doesn't just get stuck and not return - all threads in the application freeze.

What could be the cause?

The stacktrace for that thread shows:

"unnamed thread" at <0xffffffff> at (wrapper managed-to-native) System.Threading.Monitor.Monitor_wait (object,int) [0x00000] in :0 at System.Threading.Monitor.ObjWait (bool,int,object) [0x0002f] in :0 at System.Threading.Monitor.Wait (object,int,bool) [0x0000e] in :0 at System.Threading.Monitor.Wait (object,int) [0x00000] in :0 at System.Threading.ManualResetEventSlim.Wait (int,System.Threading.CancellationToken) [0x00141] in :0 at System.Threading.Tasks.Task.SpinThenBlockingWait (int,System.Threading.CancellationToken) [0x0002d] in :0 at System.Threading.Tasks.Task.InternalWait (int,System.Threading.CancellationToken) [0x00069] in :0 at System.Threading.Tasks.Task1<TResult_REF>.GetResultCore (bool) [0x00008] in <b78dcefd6c184245be8bf4a1e52466d9>:0 at System.Threading.Tasks.Task1.get_Result () [0x0000f] in :0 at Google.Apis.Requests.ClientServiceRequest1<TResponse_REF>.Execute () [0x0000b] in <1587d07172024990b6af5b790c2a559c>:0 at myFuncs.GCMupdates.sendToGoogleSheets (myFuncs.clsPositionManager/HistSummaryData,myFuncs.clsPositionManager/Position2HistData,System.Collections.Generic.Dictionary2,double,double,double,double,double,System.Collections.Generic.List`1) [0x00236] in <1791c5302f4a454b8cf7412b7f799253>:0 at myFuncs.GCMupdates.sendNotification (myFuncs.clsPositionManager/HistSummaryData,double,myFuncs.clsPositionManager/Position2HistData,myFuncs.subLog) [0x009c3] in <1791c5302f4a454b8cf7412b7f799253>:0 at Master.MainForm.UpdateDets (myFuncs.clsPositionManager/HistSummaryData,int,int,double,myFuncs.clsPositionManager/Position2HistData,myFuncs.subLog) [0x0063e] in <4860a2c0b9a848eeab8026906aeac5a8>:0 at (wrapper runtime-invoke) .runtime_invoke_void__this___object_int_int_double_object_object (object,intptr,intptr,intptr) [0x0006b] in <4860a2c0b9a848eeab8026906aeac5a8>:0 at <0xffffffff> at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) [0x0000c] in :0 at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x0003b] in :0 at System.Reflection.MethodBase.Invoke (object,object[]) [0x00000] in :0 at System.Delegate.DynamicInvokeImpl (object[]) [0x000e7] in :0 at System.MulticastDelegate.DynamicInvokeImpl (object[]) [0x00008] in :0 at System.Delegate.DynamicInvoke (object[]) [0x00000] in :0 at System.Windows.Forms.XplatUIDriverSupport.ExecutionCallback (System.Windows.Forms.AsyncMethodData) [0x00007] in <951cc200450d41168b6f8c8543d9b41e>:0 at System.Windows.Forms.XplatUIDriverSupport.ExecutionCallbackInContext (object) [0x00027] in <951cc200450d41168b6f8c8543d9b41e>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in :0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in :0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x0002b] in :0 at System.Windows.Forms.XplatUIDriverSupport.ExecuteClientMessage (System.Runtime.InteropServices.GCHandle) [0x00028] in <951cc200450d41168b6f8c8543d9b41e>:0 at System.Windows.Forms.XplatUIX11.GetMessage (object,System.Windows.Forms.MSG&,intptr,int,int) [0x01762] in <951cc200450d41168b6f8c8543d9b41e>:0 at System.Windows.Forms.XplatUI.GetMessage (object,System.Windows.Forms.MSG&,intptr,int,int) [0x00000] in <951cc200450d41168b6f8c8543d9b41e>:0 at System.Windows.Forms.Application.RunLoop (bool,System.Windows.Forms.ApplicationContext) [0x0034e] in <951cc200450d41168b6f8c8543d9b41e>:0 at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext) [0x00011] in <951cc200450d41168b6f8c8543d9b41e>:0 at System.Windows.Forms.Application.Run (System.Windows.Forms.Form) [0x00006] in <951cc200450d41168b6f8c8543d9b41e>:0 at Master.Program.Main (string[]) [0x00137] in <4860a2c0b9a848eeab8026906aeac5a8>:0 at (wrapper runtime-invoke) .runtime_invoke_void_object (object,intptr,intptr,intptr) [0x0004e] in <4860a2c0b9a848eeab8026906aeac5a8>:0

来源:https://stackoverflow.com/questions/52488562/google-apis-sheets-v4-sheetsservice-execute-freezes-application-in-dotnet-mono

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!