Skip to content

Commit

Permalink
Fix Alluxio CacheManager leak on coordinator
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed May 15, 2024
1 parent 212455d commit 870c0bb
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import io.trino.filesystem.TrinoInputStream;
import io.trino.filesystem.cache.AllowFilesystemCacheOnCoordinator;
import io.trino.filesystem.cache.TrinoFileSystemCache;
import jakarta.annotation.PreDestroy;

import java.io.IOException;
import java.util.Optional;
Expand Down Expand Up @@ -64,6 +65,15 @@ public AlluxioCoordinatorFileSystemCache(
}
}

@PreDestroy
public void shutdown()
throws Exception
{
if (alluxioFileSystemCache.isPresent()) {
alluxioFileSystemCache.get().shutdown();
}
}

@Override
public TrinoInput cacheInput(TrinoInputFile delegate, String key)
throws IOException
Expand Down

0 comments on commit 870c0bb

Please sign in to comment.