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.

Sync over Async Issue [FeatureChecker]

See original GitHub issue
  • Current Version
  • .Net Core.
  • Remove Feature and Check Tenant for the removed feature in separate async method not returning expected results.

In this file src/Abp/Application/Features/FeatureChecker.cs

public Task<string> GetValueAsync(string name)

is not async and what it calls

return GetValueAsync(AbpSession.TenantId.Value, name);

is not awaited.

I’m trying to remove a feature from a tenant, and then checking it seperatly in another method. When i check the if the tenant has the feature it exists when it is not supposed to exist.

I believe because the method mentioned above isn’t async the Task jumps back up before completion and is displaying the “old” value upon trying to read the value from the DB.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
malimingcommented, Jul 2, 2019

Thanks, I will download your code and try to solve it.

1reaction
dontboylecommented, Jun 26, 2019

@maliming Working on Test Project now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixing sync over async issues in .NET
Hi. Early on you state that the problem with DoAsyncOperationWell().Result is that we tied up two threads. Is that true if you're calling ......
Read more >
The sync over async issue is a real common problem for ...
The sync over async issue is a real common problem for me when trying to get a large older codebase converted to async...
Read more >
Detecting Sync over Async Code in ASP.NET Core
Not properly awaiting async calls can lead to thread pool starvation. Most often caused by sync over async code. Here's how you can...
Read more >
Fixing sync over async issues in .NET / C# with Visual Studio ...
Asynchronous programming has been around for several years on the .NET platform but has historically been very difficult to do well.
Read more >
feature management documentation
The IsEnabledAsync and other methods also have sync versions. The IsEnabled method should be used for boolean type features, otherwise you may get...
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