Content Deep Dive

Hunting a delayed deadlock that hid for two years in Namespace's tiered Bazel cache

Blog post from Namespace

Post Details
Company
Date Published
Author
Matteo Kamm
Word Count
1,587
Company Posts That Month
3
Language
-
Hacker News Points
5
Post removed?
No
Summary

Namespace diagnosed a severe Bazel cache performance regression caused by a two-year-old concurrency bug that appeared only with large uploads, slow clients, and multiplexed gRPC streams. Its remote cache uses local disk as a hot tier and distributed object storage as a warm tier, but a global semaphore intended to limit blocking filesystem operations was held throughout entire client upload streams rather than only during disk writes. Slow uploads could therefore occupy semaphore slots for minutes, blocking both new uploads and cache-miss reads, while use of a background context caused cancelled requests to continue waiting. HTTP/2 flow control turned this congestion into a deadlock-like circular dependency: streams waiting for semaphore slots stopped consuming data, exhausting shared connection flow-control credit and preventing streams holding slots from receiving enough data to finish and release them. Namespace fixed the issue by using request-aware, time-limited semaphore acquisition, making the semaphore configurable and disabling it for this cache workload, while also limiting concurrent streams and enlarging connection flow-control windows as safeguards.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.