{"record":{"id":"dd15eeb77d7e6a88","repo":"tursodatabase/turso","slug":"local-sync-server-on-port-port-did-not-become-re","errorCode":null,"errorMessage":"local sync server on port {port} did not become ready within {READY_TIMEOUT:?}","messagePattern":"local sync server on port (.+?) did not become ready within (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"bindings/rust/src/sync.rs","lineNumber":1261,"sourceCode":"                        }\n                        match child\n                            .try_wait()\n                            .context(\"failed to poll local sync server\")?\n                        {\n                            Some(status) => {\n                                // Child exited (most likely the port was\n                                // reserved or already taken): retry.\n                                eprintln!(\n                                    \"local sync server on port {port} exited with {status} \\\n                                     before becoming ready (attempt {attempt}/{SPAWN_ATTEMPTS})\"\n                                );\n                                break;\n                            }\n                            None => {\n                                if started.elapsed() > READY_TIMEOUT {\n                                    let _ = child.kill();\n                                    let _ = child.wait();\n                                    return Err(anyhow!(\n                                        \"local sync server on port {port} did not become ready \\\n                                         within {READY_TIMEOUT:?}\"\n                                    ));\n                                }\n                            }\n                        }\n                        sleep(Duration::from_millis(100));\n                    }\n                }\n                Err(anyhow!(\n                    \"local sync server failed to start after {SPAWN_ATTEMPTS} attempts\"\n                ))\n            }\n        }\n\n        pub fn db_url(&self) -> &str {\n            &self.db_url\n        }","sourceCodeStart":1243,"sourceCodeEnd":1279,"githubUrl":"https://github.com/tursodatabase/turso/blob/492c4a71cd7c2649e7df83da1471b74f4b1c7aa9/bindings/rust/src/sync.rs#L1243-L1279","documentation":"Thrown by TursoServer::spawn in the bindings/rust sync tests when the spawned sync server process stays alive but never accepts connections on its port within READY_TIMEOUT (60 seconds). The readiness loop kills the child and returns this error from bindings/rust/src/sync.rs:1164. It means startup is slow or blocked, not that the port was taken (that branch retries instead).","triggerScenarios":"The server binary hangs during startup (waiting on a lock, slow key generation, blocked on network); the machine is so loaded that bind+listen exceeds 60s; container seccomp or firewall rules silently drop the listen socket.","commonSituations":"CI runners executing many test shards in parallel; first-run costs like entropy or asset generation inside minimal containers; nested virtualization slowing everything down.","solutions":["Re-run the test first - slow starts are usually transient under load","Run the server binary manually with the same arguments to see where startup stalls","Lower test parallelism so startup finishes within the 60s budget","If reproducible, temporarily raise READY_TIMEOUT in bindings/rust/src/sync.rs to confirm it is timing, not a hang"],"exampleFix":"// bindings/rust/src/sync.rs - local diagnosis only\n// before\nconst READY_TIMEOUT: Duration = Duration::from_secs(60);\n// after\nconst READY_TIMEOUT: Duration = Duration::from_secs(180);","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"for _ in 0..3 {\n    match TursoServer::spawn(&ctx).await {\n        Ok(server) => return Ok(server),\n        Err(e) if e.to_string().contains(\"did not become ready\") => continue,\n        Err(e) => return Err(e),\n    }\n}","preventionTips":["Keep test parallelism low enough that server startup fits the 60s budget","Run the server binary manually once to know its normal startup time","Watch for container sandbox rules that block listening sockets"],"tags":["sync","test-harness","startup","timeout","process-spawn","rust"],"backgroundTag":"service-startup-timeout","analyzedSha":"492c4a71cd7c2649e7df83da1471b74f4b1c7aa9","analyzedAt":"2026-08-20T07:02:18.389Z","contentChangedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}