MyOwnClone / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
Apache License 2.0
1 stars 0 forks source link

Making request through ServiceAccountCredential never returns in IIS/ASP.net #412

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create instance of ServiceAccountCrential
2. Run an operation either directly on the ServiceAccountCredential (e.g 
InterceptAsync) or on a GoogleService which uses the ServiceAccountCredential 
(e.g. DriveService -->request.Execute()) and wait. No response will ever come.

What is the expected output? 
A result of some sort. 
What do you see instead?
No response

What version of the product are you using?
1.6.x beta - pre release
What is your operating system?
windows
What is your IDE?
visual studio
What is the .NET framework version?
4.0
Please provide any additional information below.

Looking at the source code for ServiceAccountCredential, the problem appears to 
be related to the use of async and await. This model in ASP.Net/IIS will causes 
issues with SynchronizationContext. 
When I wrapped the functionality in code that blocked the calling thread  I saw 
the behavior I expected. Likewise when I modified the source to operate 
synchronously, I saw the behavior I expected (i.e. results returning).

Original issue reported on code.google.com by sc...@insight.ly on 7 Nov 2013 at 6:18

GoogleCodeExporter commented 9 years ago
I think I found the problem you encountered.
We should use the ConfigureAwait(false)

It may be fixed in a patch to 1.6.0-beta or in the next version

Original comment by pele...@google.com on 7 Nov 2013 at 4:12

GoogleCodeExporter commented 9 years ago
https://codereview.appspot.com/22880043/

Original comment by pele...@google.com on 7 Nov 2013 at 4:20

GoogleCodeExporter commented 9 years ago
1.7 - https://codereview.appspot.com/22880043/
1.6.1 - https://codereview.appspot.com/23590043

Original comment by pele...@google.com on 8 Nov 2013 at 2:57

GoogleCodeExporter commented 9 years ago

Original comment by pele...@google.com on 10 Nov 2013 at 8:17

GoogleCodeExporter commented 9 years ago

Original comment by pele...@google.com on 18 Nov 2013 at 3:22

GoogleCodeExporter commented 9 years ago

Original comment by Pele...@gmail.com on 26 Nov 2013 at 1:54