{"record":{"id":"63e942b8381c6d1e","repo":"Hmbown/CodeWhale","slug":"runtime-event-lock-timed-out-after","errorCode":null,"errorMessage":"Runtime event lock timed out after {:?}","messagePattern":"Runtime event lock timed out after (.+?)","errorType":"exception","errorClass":"RuntimeEventLockTimeout","httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_threads.rs","lineNumber":9012,"sourceCode":"fn validate_same_runtime_store_file_handles(\n    first: &File,\n    second: &File,\n    path: &Path,\n) -> Result<()> {\n    let first = runtime_store_file_identity(first)?;\n    let second = runtime_store_file_identity(second)?;\n    anyhow::ensure!(\n        first == second,\n        \"Runtime event file changed: {}\",\n        path.display()\n    );\n    Ok(())\n}\n\nfn wait_for_event_lock(started: Instant, timeout: Duration) -> Result<()> {\n    let elapsed = started.elapsed();\n    if elapsed >= timeout {\n        return Err(anyhow!(RuntimeEventLockTimeout(timeout)));\n    }\n    std::thread::sleep(EVENT_TRANSACTION_LOCK_POLL.min(timeout - elapsed));\n    Ok(())\n}\n\nfn rollback_failed_event_append_handle(rollback_file: &File, original_len: u64) -> Result<()> {\n    rollback_file\n        .set_len(original_len)\n        .context(\"Failed to roll back Runtime event\")?;\n    rollback_file\n        .sync_all()\n        .context(\"Failed to sync Runtime event rollback\")\n}\n\nfn reject_symlinked_store_dir(path: &Path) -> Result<()> {\n    let Ok(metadata) = fs::symlink_metadata(path) else {\n        return Ok(());\n    };","sourceCodeStart":8994,"sourceCodeEnd":9030,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/runtime_threads.rs#L8994-L9030","documentation":"Raised by wait_for_event_lock when the elapsed time since started already meets or exceeds the lock timeout before the next retry sleep: the Runtime event-file lock could not be acquired within the budget (RuntimeEventLockTimeout). It means contention on the event lock persisted longer than the configured EVENT_TRAN... sleep/timeout window allows.","triggerScenarios":"Thrown at crates/tui/src/runtime_threads.rs:9012 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Find the holder of the event lock — usually another Codewhale process or a stuck writer — and let it finish or terminate it","Retry the operation once the contention clears","If this recurs, increase the lock timeout or reduce concurrent runtimes sharing the same event file"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}