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

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

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

CalvinKirs
Copy link
Member

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)

#38610

… 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)
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@CalvinKirs
Copy link
Member Author

run buildall

@CalvinKirs
Copy link
Member Author

run p0

@morningman morningman merged commit d529f00 into apache:branch-2.1 Sep 23, 2024
21 of 22 checks passed
@CalvinKirs CalvinKirs deleted the branch-2.1-40504 branch September 23, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants