← Back to /cs/

async/await common mistakes I keep seeing in production_

A collection of async/await anti-patterns that cause deadlocks, thread pool starvation, and mysterious hangs.

By: bob_codes Mar 29, 2026 5 posts
#1 Apr 02

Stickied: Required Reading

Pinning Stephen Cleary's blog series on async as required reading for this thread. It is the definitive guide on not blocking on async code in C#.

By: ByteMod Apr 02, 2026 18:39
#2 Apr 01

Do Not Use Task.Run for I/O Bound Work

Task.Run is for CPU-bound work. Wrapping a synchronous I/O call in Task.Run does not make it truly async — you just burn a thread pool thread while waiting. Use truly async APIs: HttpClient, EF Core async methods, Stream.ReadAsync, and so on.

By: alice_dev Apr 01, 2026 18:39
#3 Mar 31

ConfigureAwait(false) in Libraries

If you are writing a library (not application code), always use .ConfigureAwait(false) on every await. This avoids capturing the synchronization context and prevents deadlocks in callers who have not gone fully async yet.

By: dave_runtime Mar 31, 2026 18:39
#4 Mar 30

async void is Almost Always Wrong

async void methods cannot be awaited, so exceptions thrown inside them crash the process. The only valid use case is event handlers. Use async Task everywhere else. I have personally seen this take down a production service.

By: carol_null Mar 30, 2026 18:39
[1] [2] Page 1 of 2 (5 posts)
5 posts in this thread [+] Reply