Skip to content

Conversation

@HyukjinKwon
Copy link
Member

What changes were proposed in this pull request?

This PR is a followup of #46683 that replaces our custom cleaner to JDK's cleaner.

Why are the changes needed?

Reuse the standard builtin library.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

I manually tested via reenabling CheckpointSuite.checkpoint gc derived DataFrame

Was this patch authored or co-authored using generative AI tooling?

No.

.setRelation(proto.CachedRemoteRelation.newBuilder().setRelationId(dfID).build())
}
} catch {
case e: Throwable => logError("Error in cleaning thread", e)
Copy link
Member Author

Choose a reason for hiding this comment

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

The error is swollen but I think it's better to explicitly log

@HyukjinKwon
Copy link
Member Author

cc @hvanhovell

}
cleaningThread.join()
}
private val cleaner = Cleaner.create()
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that the lifecycle of SessionCleaner is the same as SparkSession, so when the client holds multiple SparkSessions, multiple instances of java.lang.ref.Cleaner will be created. If cleaner is defined in the companion object of SessionCleaner, it can allow multiple SessionCleaner to share one java.lang.ref.Cleaner instance . Can this meet the requirements?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can have one and share between other sessions but wanted to scope the cleaning specific to a session so it doesn't affect other sessions. I am fine either way though.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can do this in a follow-up? @LuciferYang is there any concrete concern here? Or are you just being tidy?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's fine, we can make follow-up when this really becomes an issue :)

@HyukjinKwon
Copy link
Member Author

Merged to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants