{"record":{"id":"247b23fb60cf798a","repo":"nautechsystems/nautilus_trader","slug":"failed-to-send-execution-report-e","errorCode":null,"errorMessage":"Failed to send execution report: {e}","messagePattern":"Failed to send execution report: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/live/src/execution/emitter.rs","lineNumber":524,"sourceCode":"    pub fn send_execution_report(&self, report: ExecutionReport) {\n        if let Err(e) = self.try_send_execution_report(report) {\n            log::warn!(\"{e}\");\n        }\n    }\n\n    /// Emits an execution report and returns any channel error to the caller.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the sender is not initialized or the receiving channel is closed.\n    pub fn try_send_execution_report(&self, report: ExecutionReport) -> anyhow::Result<()> {\n        let sender = self.sender.load();\n        let sender = sender.as_ref().ok_or_else(|| {\n            anyhow::anyhow!(\"Cannot send execution report: sender not initialized\")\n        })?;\n        sender\n            .send(ExecutionEvent::Report(report))\n            .map_err(|e| anyhow::anyhow!(\"Failed to send execution report: {e}\"))\n    }\n\n    /// Emits an order status report.\n    pub fn send_order_status_report(&self, report: OrderStatusReport) {\n        self.send_execution_report(ExecutionReport::Order(Box::new(report)));\n    }\n\n    /// Emits a fill report.\n    pub fn send_fill_report(&self, report: FillReport) {\n        self.send_execution_report(ExecutionReport::Fill(Box::new(report)));\n    }\n\n    /// Emits an order status report bundled with the fills that produced it.\n    pub fn send_order_with_fills(&self, report: OrderStatusReport, fills: Vec<FillReport>) {\n        self.send_execution_report(ExecutionReport::OrderWithFills(Box::new(report), fills));\n    }\n\n    /// Emits a position status report.","sourceCodeStart":506,"sourceCodeEnd":542,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/live/src/execution/emitter.rs#L506-L542","documentation":"try_send_execution_report had a sender, but the channel send failed because the receiver side was dropped/closed. The underlying channel error is included. The execution event consumer is no longer accepting reports.","triggerScenarios":"Emitting execution reports after the execution engine receiver was torn down — during shutdown, engine restart, or after the consuming task exited (crash/panic).","commonSituations":"Late venue fill/status messages arriving during node teardown; reconnect handlers emitting stale reports while the engine is restarting.","solutions":["Halt report emission once shutdown begins; drop or log late messages.","Wait for reconnect to re-establish the channel before re-emitting.","Log at warn during teardown races instead of failing hard.","Inspect the embedded channel error to confirm the receiver-closed cause."],"exampleFix":"// before\nemitter.try_send_execution_report(report)?;\n// after\nif let Err(e) = emitter.try_send_execution_report(report) {\n    log::warn!(\"execution report dropped (receiver closed): {e}\");\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if let Err(e) = emitter.try_send_execution_report(report) { log::warn!(\"report dropped (receiver closed): {e}\"); }","preventionTips":["Drain/stop venue streams before engine teardown","Drop late messages during shutdown rather than erroring","Log receiver-closed sends at warn to spot shutdown races"],"tags":["rust","channel","execution-report","shutdown"],"backgroundTag":"broken-pipe","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}