{"record":{"id":"94e7138c6dd97b52","repo":"nikivdev/code","slug":"jd-already-holds","errorCode":null,"errorMessage":"jd already holds {}","messagePattern":"jd already holds (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/jd.rs","lineNumber":128,"sourceCode":"fn lock_path() -> Result<PathBuf> {\n    Ok(config::ensure_global_state_dir()?.join(\"jd.lock\"))\n}\n\nfn legacy_socket_path() -> Result<PathBuf> {\n    Ok(config::ensure_global_state_dir()?.join(\"codexd.sock\"))\n}\n\n#[cfg(unix)]\nfn acquire_process_lock(file: &std::fs::File) -> Result<FileLockGuard> {\n    let fd = file.as_raw_fd();\n    let status = unsafe { libc::flock(fd, libc::LOCK_EX | libc::LOCK_NB) };\n    if status == 0 {\n        return Ok(FileLockGuard { fd });\n    }\n    let err = std::io::Error::last_os_error();\n    let raw = err.raw_os_error();\n    if raw == Some(libc::EWOULDBLOCK) || raw == Some(libc::EAGAIN) {\n        bail!(\"jd already holds {}\", lock_path()?.display());\n    }\n    Err(err).context(\"failed to lock jd process lock\")\n}\n\n#[cfg(not(unix))]\nfn acquire_process_lock(_file: &std::fs::File) -> Result<()> {\n    Ok(())\n}\n\npub fn ping() -> Result<()> {\n    let response = send_request(&CodexdRequest::Ping)?;\n    if response.ok {\n        Ok(())\n    } else {\n        bail!(\n            \"{}\",\n            response\n                .message","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/jd.rs#L110-L146","documentation":"Error \"jd already holds {}\" thrown in nikivdev/code.","triggerScenarios":"Thrown at src/jd.rs:128 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}