Skip to content

Commit

Permalink
[SPARK-42971][CORE] Change to print workdir if appDirs is null wh…
Browse files Browse the repository at this point in the history
…en worker handle `WorkDirCleanup` event

### What changes were proposed in this pull request?
This pr change to print `workdir` if `appDirs` is null when worker handle `WorkDirCleanup` event.

### Why are the changes needed?
Print `appDirs` ause a NPE because `appDirs` is null and from the context, what should be printed is `workdir`

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
Pass GitHub Actions

Closes apache#40597 from LuciferYang/SPARK-39296-FOLLOW.

Authored-by: yangjie01 <yangjie01@baidu.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
  • Loading branch information
LuciferYang authored and HyukjinKwon committed Mar 30, 2023
1 parent 12e7991 commit f105fe8
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,7 @@ private[deploy] class Worker(
val cleanupFuture: concurrent.Future[Unit] = concurrent.Future {
val appDirs = workDir.listFiles()
if (appDirs == null) {
throw new IOException(
s"ERROR: Failed to list files in ${appDirs.mkString("dirs(", ", ", ")")}")
throw new IOException(s"ERROR: Failed to list files in $workDir")
}
appDirs.filter { dir =>
// the directory is used by an application - check that the application is not running
Expand Down

0 comments on commit f105fe8

Please sign in to comment.