{"record":{"id":"57e69ccf15dfefd7","repo":"nautechsystems/nautilus_trader","slug":"failed-to-send-order-accepted-event-e","errorCode":null,"errorMessage":"Failed to send order accepted event: {e}","messagePattern":"Failed to send order accepted event: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/interactive_brokers/src/execution/core_tracking.rs","lineNumber":322,"sourceCode":"        if context.accepted {\n            return Ok(false);\n        }\n\n        let event = OrderAccepted::new(\n            context.trader_id,\n            context.strategy_id,\n            context.instrument_id,\n            context.client_order_id,\n            venue_order_id,\n            account_id,\n            UUID4::new(),\n            ts_event,\n            ts_event,\n            false,\n        );\n        exec_sender\n            .send(ExecutionEvent::Order(OrderEventAny::Accepted(event)))\n            .map_err(|e| anyhow::anyhow!(\"Failed to send order accepted event: {e}\"))?;\n        context.accepted = true;\n\n        Ok(true)\n    }\n\n    #[allow(clippy::too_many_arguments)]\n    pub(super) fn remove_order_tracking(\n        ib_order_id: i32,\n        client_order_id: ClientOrderId,\n        order_id_map: &Arc<Mutex<AHashMap<ClientOrderId, i32>>>,\n        venue_order_id_map: &Arc<Mutex<AHashMap<i32, ClientOrderId>>>,\n        instrument_id_map: &Arc<Mutex<AHashMap<i32, InstrumentId>>>,\n        trader_id_map: &Arc<Mutex<AHashMap<i32, TraderId>>>,\n        strategy_id_map: &Arc<Mutex<AHashMap<i32, StrategyId>>>,\n        active_order_contexts: &Arc<Mutex<AHashMap<i32, TrackedOrderContext>>>,\n        terminal_order_contexts: &Arc<Mutex<FifoCacheMap<i32, TrackedOrderContext, 10_000>>>,\n    ) {\n        order_id_map.lock().remove(&client_order_id);","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/interactive_brokers/src/execution/core_tracking.rs#L304-L340","documentation":"emit_order_accepted sends an OrderAccepted event through exec_sender once the adapter has confirmed the IB order was accepted, then sets context.accepted = true. This error is the map_err on the channel send — the accepted event could not be delivered, so strategy/execution state machines will not advance even though IB accepted the order.","triggerScenarios":"An order acceptance arriving (from IB order status callback) while the exec event channel receiver is dropped/closed/full — engine shutdown, disconnect, or bus misconfiguration.","commonSituations":"Stopping the trading node just as fill/acceptance messages arrive; MessageBus channel exhaustion during high order throughput; adapter lifecycle bugs dropping the receiver early.","solutions":["Inspect the inner {e} channel error to identify receiver-dropped vs backpressure.","Keep the ExecutionEngine running until all in-flight orders reach a terminal state before shutdown.","Reconnect the execution client and reconcile open orders after a dropped acceptance.","Increase exec channel capacity or throttle order flow if saturation is the cause."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"assert!(!exec_sender.is_closed(), \"exec channel receiver dropped before acceptance could be emitted\");","typeGuard":null,"tryCatchPattern":"if let Err(e) = exec_client.submit_order(cmd).await {\n    if e.to_string().contains(\"Failed to send order accepted event\") {\n        // IB accepted the order but the event was lost: reconcile open orders\n    }\n}","preventionTips":["Delay node shutdown until in-flight orders are terminal.","Reconcile open orders with IB on startup/reconnect to recover lost acceptances.","Monitor and size exec event channels for expected throughput."],"tags":["interactive-brokers","channel","event-bus","order-accepted","rust"],"backgroundTag":"broken-pipe","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"}