question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fluent API Deadlocks

See original GitHub issue

In Console Application everything work’s well

         IVirtualMachine vm = await azure.VirtualMachines.GetByResourceGroupAsync("*", "*");

         PowerState powerState = vm.PowerState;

         string ip = vm.GetPrimaryPublicIPAddress().IPAddress;`

but in Web Application I must wrap getting PowerState and IP inside new Task

`

        IVirtualMachine vm = await azure.VirtualMachines.GetByResourceGroupAsync("*", "*");

        PowerState powerState = null;

        string ip = null;

        await Task.Run(() => ip = vm.GetPrimaryPublicIPAddress().IPAddress);

        await Task.Run(() => powerState = vm.PowerState);

`

Without that application is unresponisive. This state is probably result of deadlock in GetPrimaryPublicIpAddress() method and PowerState property.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tugberkugurlucommented, Jul 29, 2017

I get the same when running List on IDatabases which you get by listing the SQL Servers on Azure. This happens under ASP.NET which has an ambient SynchronizationContext. I sense that somewhere it has been skipped to call ConfigureAwait(false) on an awaited Task and List calls an async method in a blocking way.

0reactions
martinsawickicommented, Oct 10, 2017

asp.net related deadlock issues should have been addressed in v1.2

Read more comments on GitHub >

github_iconTop Results From Across the Web

threading, fluent nhibernate and saving data get deadlock
i use C# threading and parsing some data and when i try to save and commit this data with fluent nhibernate i get...
Read more >
Issues with Azure Management SDK Deadlocking an await ...
I am trying to build an application that Clones an Azure hosted database using the Azure.Management.Fluent SDK in C#. from the controller I ......
Read more >
Deadlock, Starvation, and Livelock
A deadlock is a state in which each member of a group of actions, is waiting for some other member to release a...
Read more >
SQL Deadlock on the same exclusively locked clustered ...
I have a couple of thoughts. First of all, the easiest way to avoid deadlocks is to always take locks in the same...
Read more >
Concurrency Management in Entity Framework Core
Pessimistic concurrency involves locking database records to prevent other users from being able to access/change them until the lock is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found