{"record":{"id":"4f86bf1188c445b8","repo":"xai-org/grok-build","slug":"upload-queue-closed","errorCode":null,"errorMessage":"Upload queue closed","messagePattern":"Upload queue closed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-file-utils/src/queue.rs","lineNumber":1149,"sourceCode":"            client_version: self.client_version.clone(),\n            compress,\n            parent_span: tracing::Span::current(),\n            _in_flight: in_flight,\n        };\n        self.stats.pending.fetch_add(1, Ordering::Relaxed);\n        self.stats\n            .pending_bytes\n            .fetch_add(original_size, Ordering::Relaxed);\n        self.stats.enqueued.fetch_add(1, Ordering::Relaxed);\n        if let Err(e) = self.tx.send(item).await {\n            let rejected = e.0;\n            remove_owned_source(&rejected.source, Some(&self.stats));\n            self.stats.pending.fetch_sub(1, Ordering::Relaxed);\n            self.stats\n                .pending_bytes\n                .fetch_sub(original_size, Ordering::Relaxed);\n            self.stats.notify_transition();\n            return Err(anyhow::anyhow!(\"Upload queue closed\"));\n        }\n        Ok(EnqueueResult {\n            completion_rx: rx,\n            original_size,\n        })\n    }\n    /// Enqueue a working-tree file by taking an immutable reflink/CoW snapshot of\n    /// it into the queue dir, verifying that snapshot against `expected_sha256`,\n    /// then uploading the snapshot (never the live source).\n    ///\n    /// Snapshotting at enqueue closes the verify-then-upload corruption window:\n    /// verify and upload operate on the SAME bytes, so a later mutation of the\n    /// working-tree file cannot poison the content-addressed object.\n    ///\n    /// Reflink-vs-copy disk budgeting is handled at the `snapshot_route` gate\n    /// below. A stale snapshot (source changed since the manifest hash) is\n    /// discarded and the completion resolves to a non-fatal `Err`. Mirrors\n    /// `enqueue_file`'s channel-full/closed fallback. Returns an [`EnqueueResult`].","sourceCodeStart":1131,"sourceCodeEnd":1167,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-file-utils/src/queue.rs#L1131-L1167","documentation":"Error \"Upload queue closed\" thrown in xai-org/grok-build.","triggerScenarios":"Thrown at crates/codegen/xai-file-utils/src/queue.rs:1149 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}