tinyhumansai/openhuman · error

workspace lock task join failed: {e}

Error message

workspace lock task join failed: {e}

What it means

The spawn_blocking task that opens and locks .memory-write.lock itself failed to join ({e} is a tokio JoinError — panic or cancellation). The lock state is unknown, so the memory write is aborted rather than proceed unguarded.

Source

Thrown at src/openhuman/tools/impl/filesystem/update_memory_md.rs:93

        }
        let mut opts = std::fs::OpenOptions::new();
        opts.create(true).write(true).truncate(false);
        #[cfg(unix)]
        {
            // O_NOFOLLOW closes the TOCTOU window: if a symlink is swapped in
            // after the check above, the open fails (ELOOP) rather than follows.
            use std::os::unix::fs::OpenOptionsExt;
            opts.custom_flags(libc::O_NOFOLLOW);
        }
        let file = opts
            .open(&lock_path)
            .map_err(|e| anyhow::anyhow!("open workspace lock file {lock_path:?}: {e}"))?;
        file.lock_exclusive()
            .map_err(|e| anyhow::anyhow!("acquire workspace write flock: {e}"))?;
        Ok::<std::fs::File, anyhow::Error>(file)
    })
    .await
    .map_err(|e| anyhow::anyhow!("workspace lock task join failed: {e}"))?
}

/// Atomically replace `path`'s contents with `content`.
///
/// Writes to a sibling temp file in the same directory (so the rename stays on
/// one filesystem and is atomic) and `rename`s it over the target. A crash
/// mid-write leaves either the old file or the complete new file — never a
/// half-written truncation. Callers MUST hold the per-workspace write lock so
/// the read-modify-write is serialized end-to-end.
async fn atomic_write(path: &Path, file: &str, content: &str) -> anyhow::Result<()> {
    let dir = path
        .parent()
        .ok_or_else(|| anyhow::anyhow!("target path has no parent directory"))?;
    let seq = TEMP_FILE_SEQ.fetch_add(1, Ordering::Relaxed);
    let tmp_name = format!(".{file}.{}.{seq}.tmp", std::process::id());
    let tmp_path = dir.join(tmp_name);

    tracing::debug!(

View on GitHub (pinned to 7491200858)

Solutions

  1. Retry — join failures are usually transient (runtime shutdown or task panic)
  2. Check core logs for a panic inside the lock task
  3. If recurring, inspect the workspace lock file state
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/openhuman/tools/impl/filesystem/update_memory_md.rs:93 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/7ab53382d7413cb7. Report an issue: GitHub.