-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-26713][CORE] Interrupt pipe IO threads in PipedRDD when task is finished #23638
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
Changes from 1 commit
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 |
|---|---|---|
|
|
@@ -141,7 +141,7 @@ final class ShuffleBlockFetcherIterator( | |
|
|
||
| /** | ||
| * Whether the iterator is still active. If isZombie is true, the callback interface will no | ||
| * longer place fetched blocks into [[results]]. | ||
| * longer place fetched blocks into [[results]] and the iterator is marked as fully consumed. | ||
| */ | ||
| @GuardedBy("this") | ||
| private[this] var isZombie = false | ||
|
|
@@ -372,7 +372,7 @@ final class ShuffleBlockFetcherIterator( | |
| logDebug("Got local blocks in " + Utils.getUsedTimeMs(startTime)) | ||
| } | ||
|
|
||
| override def hasNext: Boolean = numBlocksProcessed < numBlocksToFetch | ||
| override def hasNext: Boolean = !isZombie && (numBlocksProcessed < numBlocksToFetch) | ||
|
||
|
|
||
| /** | ||
| * Fetches the next (BlockId, InputStream). If a task fails, the ManagedBuffers | ||
|
|
@@ -395,7 +395,7 @@ final class ShuffleBlockFetcherIterator( | |
| // then fetch it one more time if it's corrupt, throw FailureFetchResult if the second fetch | ||
| // is also corrupt, so the previous stage could be retried. | ||
| // For local shuffle block, throw FailureFetchResult for the first IOException. | ||
| while (result == null) { | ||
| while (!isZombie && result == null) { | ||
|
Contributor
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. is it possible that
Member
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. Yeah that can happen. Right now I think it's 'worse' in that the iterator might be cleaned up and yet next() will keep querying the iterator that's being drained by cleanup(). To really tighten it up I think more or all of We could follow this up with small things like making @advancedxy what do you think? I think the argument is merely that this fixes the potential issue in 99% of cases, not 100%.
Contributor
Author
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.
@cloud-fan Yeah, it can happen. But I agree with @srowen. The
Maybe. But I would leave it as it's if It's up to me. Like you said, this doesn't prevent the semantics changing but a little tighter. |
||
| val startFetchWait = System.currentTimeMillis() | ||
| result = results.take() | ||
| val stopFetchWait = System.currentTimeMillis() | ||
|
|
@@ -489,8 +489,12 @@ final class ShuffleBlockFetcherIterator( | |
| fetchUpToMaxBytes() | ||
| } | ||
|
|
||
| currentResult = result.asInstanceOf[SuccessFetchResult] | ||
| (currentResult.blockId, new BufferReleasingInputStream(input, this)) | ||
| if (result != null) { | ||
| currentResult = result.asInstanceOf[SuccessFetchResult] | ||
| (currentResult.blockId, new BufferReleasingInputStream(input, this)) | ||
| } else { // the iterator has already be closed | ||
| throw new NoSuchElementException | ||
|
||
| } | ||
| } | ||
|
|
||
| private def fetchUpToMaxBytes(): Unit = { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.