{"record":{"id":"6f6166040d52533b","repo":"nautechsystems/nautilus_trader","slug":"load-channel-closed-e","errorCode":null,"errorMessage":"load channel closed: {e}","messagePattern":"load channel closed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/infrastructure/src/redis/cache.rs","lineNumber":1407,"sourceCode":"                    let Some(value) = value else {\n                        continue;\n                    };\n\n                    if let Some(clean_key) = key.strip_prefix(&prefix) {\n                        general.insert(clean_key.to_string(), value);\n                    }\n                }\n\n                Ok(general)\n            }\n            .await;\n\n            if let Err(e) = tx.send(result) {\n                log::error!(\"Failed to send general load result: {e:?}\");\n            }\n        });\n\n        blocking_recv(&rx).map_err(|e| anyhow::anyhow!(\"load channel closed: {e}\"))?\n    }\n\n    async fn load_currencies(&self) -> anyhow::Result<AHashMap<Ustr, Currency>> {\n        DatabaseQueries::load_currencies(\n            &self.database.con,\n            &self.database.trader_key,\n            self.encoding(),\n        )\n        .await\n    }\n\n    async fn load_instruments(&self) -> anyhow::Result<AHashMap<InstrumentId, InstrumentAny>> {\n        DatabaseQueries::load_instruments(\n            &self.database.con,\n            &self.database.trader_key,\n            self.encoding(),\n        )\n        .await","sourceCodeStart":1389,"sourceCodeEnd":1425,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/infrastructure/src/redis/cache.rs#L1389-L1425","documentation":"Like `load_state`, the generic `load` helper runs a blocking Redis operation on a worker thread and receives the result through an mpsc channel. This error means `blocking_recv(&rx)` failed with `RecvError`: the sender half was dropped without delivering a result, so the worker task died or was dropped before completing.","triggerScenarios":"Any cache load operation routed through this helper (e.g. `load_currencies`, `load_instruments`) where the spawned task panics or is cancelled before `tx.send(result)` executes.","commonSituations":"Panics inside deserialization of Redis payloads; runtime teardown while a load is in flight; resource exhaustion (OOM) killing the worker thread.","solutions":["Inspect logs immediately preceding this error for a panic or 'Failed to send general load result' message to find the true failure","Retry the load after confirming the Redis connection is healthy","Check that payloads in Redis match the expected encoding/schema","Harden the worker task to return errors through the channel rather than panicking or only logging"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Rust\nmatch cache.load(...).await {\n    Ok(v) => v,\n    Err(e) if e.to_string().contains(\"load channel closed\") => {\n        log::warn!(\"load worker died ({e:#}); retrying\");\n        cache.load(...).await\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Treat this error as a symptom: find the worker panic in earlier logs","Make worker tasks return errors through the channel rather than panicking","Avoid issuing loads while shutting down the async runtime","Keep Redis payloads schema-compatible with the running binary"],"tags":["redis","channel","async","cache"],"backgroundTag":"channel-closed","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}