TLDR Web Dev · ARTICLES & TUTORIALS

THE CONCURRENCY TRAP: HOW AN ATOMIC COUNTER STALLED A PIPELINE

conviva.com9 min read

Summary from the TLDR Web Dev newsletter

Conviva's streaming analytics platform experienced a P99 latency spike for a single customer due to a bottleneck in a shared type registry used by its DAG engine. The issue was due to a high contention on an atomic counter within a concurrent hash map used for read operations. The solution was to switch from flashmap to ArcSwap, which uses a read-copy-update approach, eliminating the counter contention issues by atomically swapping the entire data structure.