-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-2532] Consolidated shuffle fixes #1609
Changes from all commits
f1182f8
66d6ec3
027c7f1
195c529
6095545
1c1faea
fbf20f7
94fbfc1
43b059e
a7d43ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,8 @@ class HashShuffleWriter[K, V]( | |
} | ||
|
||
/** Close this writer, passing along whether the map completed */ | ||
override def stop(success: Boolean): Option[MapStatus] = { | ||
override def stop(successInput: Boolean): Option[MapStatus] = { | ||
var success = successInput | ||
try { | ||
if (stopping) { | ||
return None | ||
|
@@ -71,7 +72,8 @@ class HashShuffleWriter[K, V]( | |
try { | ||
return Some(commitWritesAndBuildStatus()) | ||
} catch { | ||
case e: Exception => | ||
case e: Throwable => | ||
success = false // for finally block | ||
revertWrites() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If success != false, then release writers will attempt to register. |
||
throw e | ||
} | ||
|
@@ -96,9 +98,9 @@ class HashShuffleWriter[K, V]( | |
var totalBytes = 0L | ||
var totalTime = 0L | ||
val compressedSizes = shuffle.writers.map { writer: BlockObjectWriter => | ||
writer.commit() | ||
writer.close() | ||
writer.commitAndClose() | ||
val size = writer.fileSegment().length | ||
assert(size >= 0) | ||
totalBytes += size | ||
totalTime += writer.timeWriting() | ||
MapOutputTracker.compressSize(size) | ||
|
@@ -116,8 +118,13 @@ class HashShuffleWriter[K, V]( | |
private def revertWrites(): Unit = { | ||
if (shuffle != null && shuffle.writers != null) { | ||
for (writer <- shuffle.writers) { | ||
writer.revertPartialWrites() | ||
writer.close() | ||
try { | ||
writer.revertPartialWritesAndClose() | ||
} catch { | ||
// Ensure that all revert's get done - log exception and continue | ||
case ex: Exception => | ||
logError("Exception reverting/closing writers", ex) | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert/close can throw exception - causing other writers to be left hanging. |
||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done only to support adding marker after each object has been written.
Only practical reason to do this is to test that part.