quickwit-oss/tantivy · error

Managed directory rlock poisoned in list damaged.

Error message

Managed directory rlock poisoned in list damaged.

What it means

Fires in list_managed_files when reading the meta_informations RwLock to clone the set of managed paths. The lock is poisoned because a thread panicked while holding it, so the returned path set cannot be trusted; the panic prevents handing out a possibly stale list (which would mislead damage-detection/GC logic). It is a generic poisoned-lock sentinel, not related to any particular file input.

Source

Thrown at src/directory/managed_directory.rs:264

            .map_err(|io_error| OpenReadError::wrap_io_error(io_error, path.to_path_buf()))?;
        let bytes = data
            .read_bytes()
            .map_err(|io_error| OpenReadError::IoError {
                io_error: Arc::new(io_error),
                filepath: path.to_path_buf(),
            })?;
        let mut hasher = Hasher::new();
        hasher.update(bytes.as_slice());
        let crc = hasher.finalize();
        Ok(footer.crc() == crc)
    }

    /// List all managed files
    pub fn list_managed_files(&self) -> HashSet<PathBuf> {
        let managed_paths = self
            .meta_informations
            .read()
            .expect("Managed directory rlock poisoned in list damaged.")
            .managed_paths
            .clone();
        managed_paths
    }
}

impl Directory for ManagedDirectory {
    fn get_file_handle(&self, path: &Path) -> Result<Arc<dyn FileHandle>, OpenReadError> {
        let file_slice = self.open_read(path)?;
        Ok(Arc::new(file_slice))
    }

    fn open_read(&self, path: &Path) -> result::Result<FileSlice, OpenReadError> {
        let file_slice = self.directory.open_read(path)?;
        let (footer, reader) = Footer::extract_footer(file_slice)
            .map_err(|io_error| OpenReadError::wrap_io_error(io_error, path.to_path_buf()))?;
        footer.is_compatible()?;
        Ok(reader)

View on GitHub (pinned to b5d8deb80c)

Solutions

  1. Diagnose the original panic that poisoned the lock before relying on list_managed_files
  2. Reduce panic exposure inside the registry's lock scope by returning Results
  3. Optionally recover with PoisonError::into_inner if a best-effort listing is acceptable
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/directory/managed_directory.rs:264 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of quickwit-oss/tantivy@b5d8deb80c (2026-09-05). Data as JSON: /api/errors/f7ea34fe60d5e454. Report an issue: GitHub.