Skip to content

TTL unset from DefaultListFilesCache when CacheManagerConfig::list_files_cache_ttl is not set explicitly #19396

Closed

Description

@jizezhang

Describe the bug

If user creates a ListFilesCache with ttl set, e.g. DefaultListFilesCache::new(1024, Some(Duration::from_secs(1)), but does not set CacheManagerConfig::list_files_cache_ttl, ttl in the list_files_cache would be unset.

To Reproduce

use std::{sync::Arc, time::Duration};

use datafusion_execution::cache::{
    DefaultListFilesCache,
    cache_manager::{CacheManager, CacheManagerConfig},
};

fn main() {
    let list_file_cache = DefaultListFilesCache::new(1024, Some(Duration::from_secs(1)));

    let config =
        CacheManagerConfig::default().with_list_files_cache(Some(Arc::new(list_file_cache)));

    let cache_manager = CacheManager::try_new(&config).unwrap();

    // check on is_some() would fail
    assert!(
        cache_manager
            .get_list_files_cache()
            .unwrap()
            .cache_ttl()
            .is_some()
    );
}

with Cargo.toml

[package]
name = "list-cache"
version = "0.1.0"
edition = "2024"

[dependencies]
datafusion-execution = "51.0.0"

[patch.crates-io]
datafusion-execution = { path = '../../datafusion/datafusion/execution' }

Expected behavior

ttl from DefaultListFilesCache is preserved.

Additional context

Some discussion here #19055 (comment)

Activity

  1. added theissue type on Dec 19, 2025
  2. shashidhar-bm commented on Dec 19, 2025

    @shashidhar-bm
    Contributor

    take

  3. added a commit that references this issue on Dec 19, 2025
    887aa9f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions