Skip to content

Uninformative Memory(Wait(RecvError())) thrown from Foyer cache under high load #1118

@matthewbayer

Description

@matthewbayer

I occasionally receive a cryptic error: Memory(Wait(RecvError())) from my foyer cache when under high read load (with plenty of memory available), coming from HybridCache::obtain.

Is there any way to diagnose this, or throw a more informative error if we are indeed in an error state?

Here's my cache setup:

let working_dir = env::var(WORKING_DIR_ENV_VAR)?;
let dir = tempfile::tempdir_in(working_dir)?;

let device = FsDeviceBuilder::new(dir.path())
    .with_capacity(100 * 1024 * 1024 * 1024)
    .build()?;

let file_cache: HybridCache<String, FileData> = HybridCacheBuilder::new()
    .memory(128 * 1024 * 1024)
    .with_weighter(|_key: &String, value: &FileData| value.data.len())
    .storage()
    .with_engine_config(BlockEngineBuilder::new(device))
    .build()
    .await?;

This is on version 0.19.1, but confirmed to occur in 0.17.x and 0.18.x as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions