fix(cli): remove static file providers from cache on reth db stats (#10887)

This commit is contained in:
joshieDo
2024-09-13 15:53:39 +01:00
committed by GitHub
parent dd95508d34
commit 8ddbd30df9
2 changed files with 8 additions and 0 deletions

View File

@ -249,6 +249,12 @@ impl Command {
total_index_size += index_size;
total_offsets_size += offsets_size;
total_config_size += config_size;
// Manually drop provider, otherwise removal from cache will deadlock.
drop(jar_provider);
// Removes from cache, since if we have many files, it may hit ulimit limits
static_file_provider.remove_cached_provider(segment, fixed_block_range.end());
}
if !self.detailed_segments {

View File

@ -358,6 +358,8 @@ impl StaticFileProvider {
}
/// Given a segment and block range it removes the cached provider from the map.
///
/// CAUTION: cached provider should be dropped before calling this or IT WILL deadlock.
pub fn remove_cached_provider(
&self,
segment: StaticFileSegment,