From f4a0ba50f886ebc4a5304579197084d278d80815 Mon Sep 17 00:00:00 2001 From: "Keith Farmer (MSFT)" Date: Thu, 29 Aug 2019 17:24:11 -0700 Subject: [PATCH] Update README Updates README to include information on async deadlocks, and a suggested workaround. --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 4038d68ee..3a29f32cf 100644 --- a/README.md +++ b/README.md @@ -138,8 +138,22 @@ OAuth testing requires the ActiveDirectory identity model also available via NuG How-Tos focused around accomplishing specific tasks are available on the [Microsoft Azure .NET Developer Center][]. ## Need Help? + Be sure to check out the [Azure Community Support][] page if you have trouble with the provided code or use StackOverflow. +### Async Deadlock? + +Because of certain limitations in the HTTP stack used by the library, forcing sync APIs to use a sync-over-async implementation, sync APIs may be vulnerable to async deadlock. While we've made several automated passes through the codebase to catch those issues, some do escape us from time to time. If you encounter a deadlock due to this, there are some recommendations: + +- If possible, migrate to use the async APIs. This is the best option to take whenever possible. +- If a migration is not possible, some developers find the following pattern to work well for them: + +```csharp +Task.Run(() => SynchronousCall()).Wait(); +``` + +The new [Azure Storage libraries for .NET][azure-sdk-for-net-storage] use a different approach for providing sync support, and should be less prone to deadlock issues going forward. + ## Collaborate & Contribute We gladly accept community contributions. @@ -173,6 +187,7 @@ For general suggestions about Microsoft Azure please use our [UserVoice forum][] [Microsoft Azure Downloads Page]: http://azure.microsoft.com/en-us/downloads/?sdk=net [Get started with Azure Storage]: https://docs.microsoft.com/en-us/azure/storage/storage-dotnet-how-to-use-blobs [azure-sdk-for-net]: https://github.com/Azure/azure-sdk-for-net +[azure-sdk-for-net-storage]: https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/storage [create an account]: https://account.Azure.com/Home/Index [semver]: http://semver.org/ [emulator]: https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator