{"record":{"id":"09219908f2166b87","repo":"nautechsystems/nautilus_trader","slug":"conflicting-execution-client-claims-for-client-or","errorCode":null,"errorMessage":"Conflicting execution client claims for {client_order_id}: {existing_client_id} and {client_id}","messagePattern":"Conflicting execution client claims for (.+?): (.+?) and (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/common/src/cache/mod.rs","lineNumber":4848,"sourceCode":"    /// claim is idempotent, and a conflicting claim is rejected. The complete batch is validated\n    /// and its persistence command is successfully enqueued before any in-memory index is\n    /// changed.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if an order is not cached, an order is already claimed by another client,\n    /// the same order has conflicting claims in the batch, or persistence cannot be enqueued.\n    pub fn claim_order_clients(\n        &mut self,\n        claims: &[(ClientOrderId, ClientId)],\n    ) -> anyhow::Result<()> {\n        let mut requested = AHashMap::with_capacity(claims.len());\n        let mut ordered_claims = Vec::with_capacity(claims.len());\n\n        for (client_order_id, client_id) in claims {\n            if let Some(existing_client_id) = requested.get(client_order_id) {\n                if existing_client_id != client_id {\n                    anyhow::bail!(\n                        \"Conflicting execution client claims for {client_order_id}: \\\n                         {existing_client_id} and {client_id}\"\n                    );\n                }\n                continue;\n            }\n\n            requested.insert(*client_order_id, *client_id);\n            ordered_claims.push((*client_order_id, *client_id));\n        }\n\n        let mut pending_claims = Vec::with_capacity(ordered_claims.len());\n        for (client_order_id, client_id) in ordered_claims {\n            if !self.orders.contains_key(&client_order_id) {\n                return Err(OrderLookupError::not_found(client_order_id).into());\n            }\n\n            match self.index.order_client.get(&client_order_id) {","sourceCodeStart":4830,"sourceCodeEnd":4866,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/common/src/cache/mod.rs#L4830-L4866","documentation":"During batched execution-client claim registration, the same client_order_id appears twice in the claims list with two different ClientIds. The method builds an intermediate map and refuses inconsistent claims before any state is mutated, keeping the batch atomic.","triggerScenarios":"Calling `add_execution_client_claims`-style registration with a claims list containing the same client_order_id mapped to different clients; building the list from two sources (e.g. config + reconciliation) that disagree on ownership.","commonSituations":"Merging claim lists from multiple execution clients after reconnect; a config error routing one order to two clients; adapter reconciliation producing overlapping claim sets.","solutions":["Deduplicate/merge the claims list so each client_order_id appears once with a single ClientId.","Fix the source that assigns the wrong client for that order.","If the batch comes from config, make client routing deterministic for each order."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let mut seen: AHashMap<ClientOrderId, ClientId> = AHashMap::default();\nfor (coid, cid) in &claims {\n    if let Some(prev) = seen.get(coid) {\n        if prev != cid { /* resolve conflict before batch registration */ }\n    } else { seen.insert(coid.clone(), cid.clone()); }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Merge claim lists through one deduplicating merge step.","Keep order-to-client routing deterministic in config.","Avoid registering the same order from multiple adapters."],"tags":["rust","cache","execution-client","conflict","batch-validation"],"backgroundTag":"duplicate-claim-conflict","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"}