{"record":{"id":"650fb59caad7271c","repo":"block/buzz","slug":"repo-announcement-lost-community-serving-lease-on","errorCode":null,"errorMessage":"repo announcement lost community serving lease on release: {e}","messagePattern":"repo announcement lost community serving lease on release: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/buzz-relay/src/handlers/side_effects.rs","lineNumber":2779,"sourceCode":"    // re-announce should replay.\n    if reserved_by_this_attempt {\n        if let Err(e) =\n            emit_initial_ref_state(tenant, state, serving_write.lease(), &owner_hex, &repo_id).await\n        {\n            // Non-fatal: the manifest is the source of truth; this is just the\n            // derived notification. A failure here means subscribers miss the\n            // \"repo now exists\" event, but clone/push still works.\n            warn!(\n                repo_id = %repo_id,\n                owner = %owner_hex,\n                error = %e,\n                \"failed to emit initial kind:30618 ref state (non-fatal)\"\n            );\n        }\n    }\n\n    serving_write.finish().await.map_err(|e| {\n        anyhow::anyhow!(\"repo announcement lost community serving lease on release: {e}\")\n    })?;\n    Ok(())\n}\n\n/// Default symbolic HEAD for a freshly-announced (empty) repo. Matches\n/// `init.defaultBranch=main` (git ≥ 2.28) and the seed used by\n/// `live_hydrate_empty_repo`. Pinned in one place so the seeded manifest\n/// and the initial kind:30618 emission can't drift.\n///\n/// The first push's `cas_publish` overwrites this with the real symbolic\n/// HEAD observed in the receive-pack workspace via standard CAS, so the\n/// default is a stand-in, not a permanent commitment.\nconst DEFAULT_HEAD: &str = \"refs/heads/main\";\n\n/// Seed the manifest-pointer for a newly-announced repo with an empty manifest.\n///\n/// Idempotent: a `CasOutcome::LostRace` is treated as success **only if** the\n/// existing pointer names the same empty manifest digest. Any other pre-existing","sourceCodeStart":2761,"sourceCodeEnd":2797,"githubUrl":"https://github.com/block/buzz/blob/dad5a33865fc81a2e55b3b60746632f615ec1e3a/crates/buzz-relay/src/handlers/side_effects.rs#L2761-L2797","documentation":"At the end of handle_git_repo_announcement_inner, serving_write.finish() releases the community serving lease. This error wraps a failure during release — the lease could not be cleanly finished, indicating the deletion fence state changed (e.g. community deletion began) or the lease release operation itself failed against the database.","triggerScenarios":"The community deletion fence closes while the announcement handler is still finishing (emitting kind:30618 refs, etc.); DB failure during the finish() release call for the lease.","commonSituations":"Deletion racing with announcement completion; transient Postgres connectivity loss during lease release; long ref-state emission work extending lease lifetime into a deletion window.","solutions":["Check whether the community is being deleted; the error is often a symptom of that race rather than a bug — re-run after deletion settles.","Inspect wrapped {e} for DB-level causes (connection errors, lock timeouts) and address connectivity.","Verify the announcement's writes committed; if the event was stored but the lease release failed, reconcile fence state before retrying.","Retry the announcement; the fence will reject cleanly if the community is gone."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if let Err(e) = serving_write.finish().await {\n    tracing::error!(\"lease release failed: {e:#} — verify fence state manually\");\n    // do not retry the announcement blindly; check whether writes committed first\n}","preventionTips":["Confirm announcement writes committed before interpreting release failure as data loss.","Monitor Postgres health; transient failures here are usually connectivity.","Reconcile deletion fence state after any release failure before retrying."],"tags":["concurrency","fence","relay","cleanup"],"backgroundTag":"lost-serving-lease","analyzedSha":"dad5a33865fc81a2e55b3b60746632f615ec1e3a","analyzedAt":"2026-08-30T13:49:18.474Z","contentChangedAt":"2026-08-30T13:49:18.474Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}