Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ class HadoopMapReduceCommitProtocol(
val taskAttemptContext = new TaskAttemptContextImpl(jobContext.getConfiguration, taskAttemptId)
committer = setupCommitter(taskAttemptContext)
committer.setupJob(jobContext)
try {
val fs = stagingDir.getFileSystem(jobContext.getConfiguration)
fs.deleteOnExit(stagingDir)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the streaming Spark jobs, this increases indefinitely, doesnt' it, @AngersZhuuuu ?

IMO, we had better consider this kind of behavior change as Improvement instead of Bug to avoid any side-effect. WDYT?

cc @mridulm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think streaming job need to look at file source staging dir when restarting, this is not state store or checkpoint, cc @HeartSaVioR

Copy link
Contributor

@mridulm mridulm Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For streaming jobs, given their really long duration and large number of commits, we will keep accumulating the deleteOnExit metadata to be tracked - and eventually OOM.
I am assuming that is what @dongjoon-hyun is referring to - and I agree it is a risk.

At a minimum, we can derisk it by calling cancelDeleteOnExit for successful commits.

Btw, please do not catch Throwable

} catch {
case e: Throwable =>
logWarning(log"Exception while setting clean logic ${MDC(JOB_ID, jobContext.getJobID)}", e)
}
}

override def commitJob(jobContext: JobContext, taskCommits: Seq[TaskCommitMessage]): Unit = {
Expand Down