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

Release the reference to the calling Spark session upon successful co… #4010

Merged
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 @@ -107,7 +107,10 @@ class NonFateSharingFuture[T](pool: DeltaThreadPool)(f: SparkSession => T)
// Prefer to get a prefetched result from the future, but never fail because of it.
val futureResult = futureOpt.flatMap { case (ownerSession, future) =>
try {
Some(ThreadUtils.awaitResult(future, timeout))
val result = Some(ThreadUtils.awaitResult(future, timeout))
// no reason to keep the reference to the calling session anymore
futureOpt = Some(null, future)
result
} catch {
// NOTE: ThreadUtils.awaitResult wraps all non-fatal exceptions other than TimeoutException
// with SparkException. Meanwhile, Java Future.get only throws four exceptions:
Expand Down
Loading