{"record":{"id":"7d6232d10c9a23d4","repo":"nautechsystems/nautilus_trader","slug":"data-connect-timeout","errorCode":null,"errorMessage":"data-connect timeout","messagePattern":"data-connect timeout","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/live/src/node/mod.rs","lineNumber":2100,"sourceCode":"        };\n\n        AsyncRunner::handle_exec_event(evt);\n\n        if let Some(fill) = &recent_fill_candidate {\n            self.exec_manager.commit_recent_fill_if_applied(fill);\n        }\n    }\n\n    async fn connect_data_phase(&mut self, deadline: dst::time::Instant) -> anyhow::Result<()> {\n        // A zero remaining budget still admits an immediately-ready connect (an\n        // empty/ready client set completes on the first poll); a pending connect\n        // fails closed on that same poll. This keeps a zero `timeout_connection`\n        // - a supported \"do not wait, but allow ready work\" configuration -\n        // working, while still bounding a hung connect.\n        let remaining = deadline.saturating_duration_since(dst::time::Instant::now());\n        dst::time::timeout(remaining, self.kernel.connect_data_clients())\n            .await\n            .map_err(|_| anyhow::anyhow!(\"data-connect timeout\"))\n    }\n\n    async fn connect_exec_clients(&mut self, deadline: dst::time::Instant) -> anyhow::Result<()> {\n        let remaining = deadline.saturating_duration_since(dst::time::Instant::now());\n        dst::time::timeout(remaining, self.kernel.connect_exec_clients())\n            .await\n            .map_err(|_| anyhow::anyhow!(\"exec-connect timeout\"))\n    }\n\n    /// Connects execution clients and checks all engines are connected.\n    ///\n    /// Returns the final connection wait status.\n    /// Must be called after data clients are connected and instrument events drained.\n    async fn connect_exec_phase(\n        &mut self,\n        deadline: dst::time::Instant,\n    ) -> anyhow::Result<EngineConnectionStatus> {\n        self.connect_exec_clients(deadline).await?;","sourceCodeStart":2082,"sourceCodeEnd":2118,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/live/src/node/mod.rs#L2082-L2118","documentation":"connect_data_phase wraps self.kernel.connect_data_clients() in a timeout bounded by the remaining time until the shared connection deadline. If connecting all data clients does not finish in time, the future is cancelled and this error is returned; start() then aborts startup with \"Data client connection timed out\". A zero timeout_connection is intentionally still allowed (fails-closed-on-poll semantics), so this only fires when a real connect hangs or the budget is exhausted.","triggerScenarios":"dst::time::timeout(remaining, connect_data_clients()) elapses in connect_data_phase (mod.rs:2096-2101); remaining is deadline.saturating_duration_since(now), so earlier startup phases may have already consumed the deadline.","commonSituations":"Slow market-data venue handshakes; instrument subscription floods taking longer than timeout_connection; DNS or TLS stalls; the exec/data phase ordering consuming the shared deadline so data connect gets little time on retry paths.","solutions":["Increase timeout_connection to comfortably cover data client connects plus instrument event draining.","Verify market-data endpoint reachability and credentials; fix any adapter-level connect error surfaced in logs.","Reduce the number or cost of initial subscriptions if venue onboarding is slow.","Check DNS/proxy configuration on the host that could stall TCP/TLS establishment."],"exampleFix":"// before\ntimeout_connection: Duration::from_secs(15)\n// after\ntimeout_connection: Duration::from_secs(120)","handlingStrategy":"retry","validationCode":"// Ensure the shared connection deadline can cover data connect\nlet deadline_needed = expected_data_connect_secs + instrument_drain_secs;\nassert!(config.timeout_connection.as_secs() >= deadline_needed);","typeGuard":null,"tryCatchPattern":"match node.start().await {\n    Err(e) if e.to_string().contains(\"data-connect timeout\") => {\n        // raise timeout_connection / check market-data endpoints, then retry\n    }\n    other => other?,\n}","preventionTips":["Budget timeout_connection for both data and exec phases plus instrument draining","Verify market-data endpoint reachability before startup","Limit initial subscription fan-out on slow venues","Fix DNS/proxy stalls on the host"],"tags":["network","timeout","data","startup"],"backgroundTag":"request-timeout","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"}