Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix](hdfs-fs)The cache expiration should explicitly release the held fs #38610 #40504

Merged
merged 1 commit into from
Sep 7, 2024

Commits on Sep 7, 2024

  1. [Fix](hdfs-fs)The cache expiration should explicitly release the held…

    … fs (apache#38610)
    
    ## Proposed changes
    The RemoteFSPhantomManager class is responsible for managing phantom
    references of RemoteFileSystem objects, ensuring that the associated
    FileSystem resources are automatically cleaned up when RemoteFileSystem
    objects are garbage collected.
    
    Key features:
    
    - Phantom Reference Monitoring: The class uses a ReferenceQueue and
    PhantomReference to track RemoteFileSystem objects. When these objects
    are no longer in use and garbage collected, the class ensures the
    corresponding FileSystem resources are properly closed to prevent
    resource leaks.
    - Thread-safe Cleanup: It provides a thread-safe mechanism to start a
    cleanup thread only once. This thread runs periodically, checking the
    ReferenceQueue and closing any unused FileSystem resources.
    Resource Management: The class maintains a map between phantom
    references and their corresponding FileSystem objects, ensuring that
    these resources are cleaned up appropriately.
    - The cleanup thread runs at regular intervals, ensuring that any
    RemoteFileSystem object that is no longer in use is safely removed along
    with its associated FileSystem resources.
    
    (cherry picked from commit 922ec3a)
    CalvinKirs committed Sep 7, 2024
    Configuration menu
    Copy the full SHA
    c65e395 View commit details
    Browse the repository at this point in the history