fix(pds): store blobs from Worker, not the firehose-holding DO#165
Merged
Conversation
uploadBlob computed the CID and did the R2 put inside the AccountDurableObject. That DO is single-threaded and also holds the relay's subscribeRepos firehose WebSocket; awaiting an R2 put inside it pins the input gate (R2 latency is independent of object size — even a small link-card OG image can stall), and Cloudflare resets the object with "Durable Object storage operation exceeded timeout", dropping the firehose and desyncing the relay until a manual requestCrawl. The Worker now computes the CID and writes to R2 directly, mirroring the existing sync.getBlob download path, and only calls the DO (new rpcTrackBlob) for the small imported_blobs tracking row. rpcUploadBlob is removed.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
atproto-pds | 5e70483 | May 15 2026, 07:10 PM |
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Durable Object storage operation exceeded timeout which caused object to be resetoncom.atproto.repo.uploadBlob, which dropped the relay'ssubscribeReposfirehose connection and left it desynced until a manualrequestCrawl.uploadBlobcomputed the CID and did the R2putinside the AccountDurableObject. That DO is single-threaded and also holds the firehose WebSocket; awaiting an R2 put inside it pins the input gate, and R2 latency is independent of object size — even a small image can stall long enough for Cloudflare to reset the object.sync.getBlobdownload path (which already bypasses the DO with the comment "R2ObjectBody can't be serialized across RPC"). The DO is only called for the smallimported_blobstracking row via a newrpcTrackBlob.rpcUploadBlobis removed.Why #162 didn't cover this
#162 fixed in-memory
Repodivergence in the record-write paths. This is a different mechanism: the whole DO is reset, not a caught write error, so that fix can't apply. The two together close both desync paths.Test plan
pnpm --filter @getcirrus/pds test:unit— 273 tests pass (incl.blobs.test.ts)requestCrawl