This is an automated email from the ASF dual-hosted git repository.
ethanfeng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/celeborn.git
The following commit(s) were added to refs/heads/main by this push:
new d4e13b6ba [CELEBORN-2128] Close hadoopFs FileSystem when worker is
closed
d4e13b6ba is described below
commit d4e13b6ba2e61143ea65b43a3b3d8ef745b0e407
Author: xxx <[email protected]>
AuthorDate: Wed Aug 27 14:12:55 2025 +0800
[CELEBORN-2128] Close hadoopFs FileSystem when worker is closed
### What changes were proposed in this pull request?
Close hadoopFs FileSystem when worker is closed.
### Why are the changes needed?
When the worker is closed, close the hadoopFs FileSystem to avoid resource
leakage.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
CI.
Closes #3449 from xy2953396112/CELEBORN-2128.
Authored-by: xxx <[email protected]>
Signed-off-by: mingji <[email protected]>
---
.../service/deploy/worker/storage/StorageManager.scala | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git
a/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManager.scala
b/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManager.scala
index c9b24f389..bbb273afc 100644
---
a/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManager.scala
+++
b/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManager.scala
@@ -800,6 +800,19 @@ final private[worker] class StorageManager(conf:
CelebornConf, workerSource: Abs
}
def close(exitKind: Int): Unit = {
+ if (hadoopFs != null) {
+ hadoopFs.asScala.foreach {
+ case (storageType, fs) =>
+ if (fs != null) {
+ try {
+ fs.close()
+ } catch {
+ case t: Throwable =>
+ logError(s"Close $storageType FileSystem ${fs.getUri}
failed.", t)
+ }
+ }
+ }
+ }
if (db != null) {
if (exitKind == CelebornExitKind.WORKER_GRACEFUL_SHUTDOWN) {
try {