Skip to main content

BLOB_READ_CONCURRENCY

Static BLOB_READ_CONCURRENCY 

Source
static BLOB_READ_CONCURRENCY: Semaphore
Expand description

How many com.atproto.sync.getBlob calls may hold a blocking-pool thread at once, across every caller.

One read takes a thread twice: once to hash the file against the CID it is filed under, and once for the task that reads the body out, which BLOB_READAHEAD’s back-pressure parks for as long as the client is slow to take it. That pool is the same one session creation, provisioning, deletion and firehose publishing draw from, and it holds fewer threads than crate::MAX_CONCURRENT_REQUESTS can put in front of it. One permit covers both threads of one read, from the hash until the body ends.

A caller that finds every permit taken waits for one, and crate::routes::REQUEST_TIMEOUT’s layer answers 503 if that wait outlasts the request.