ShashidharM0118 opened a new pull request, #19401:
URL: https://github.com/apache/datafusion/pull/19401
## Which issue does this PR close?
Closes #19396.
## Rationale for this change
Previously, when a `DefaultListFilesCache` was created with a TTL (e.g.,
`DefaultListFilesCache::new(1024, Some(Duration::from_secs(1)))`) and passed to
`CacheManagerConfig` without explicitly setting `list_files_cache_ttl`, the
cache's TTL would be unexpectedly unset (overwritten to `None`).
This happened because `CacheManager::try_new()` always called
`update_cache_ttl(config.list_files_cache_ttl)`, even when the config value was
`None`.
## What changes are included in this PR?
- Modified `CacheManager::try_new()` to only update the cache's TTL if
`config.list_files_cache_ttl` is explicitly set (`Some(value)`). If the config
TTL is `None`, the cache's existing TTL is preserved.
- Added two test cases:
- `test_ttl_preserved_when_not_set_in_config`: Verifies that TTL is
preserved when not set in config
- `test_ttl_overridden_when_set_in_config`: Verifies that TTL can still be
overridden when explicitly set in config
## Are these changes tested?
Yes
## Are there any user-facing changes?
Yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]