Recommended handling in ConcurrencyDictionary<string, Task<T>> when task fails

Author: passuiedCreated Mar 13, 2020Updated Mar 27, 2021

Hi @davidfowl,

Trying to get rid of Task.Result in our code and follow your approach in AsyncGuidance.md#concurrentdictionarygetoradd by storing the Task instead of the actual value. In our tests, it causes issue when the task fails (e.g. HTTP Exception) but the task obviously still gets added to the cache...

Any recommendations here?

Thanks, Patrick

Source: davidfowl/AspNetCoreDiagnosticScenarios