-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-23040][CORE]: Returns interruptible iterator for shuffle reader #20449
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
acca0e3
ddeffd8
88e86e0
ba2f355
d6ed9a1
8c15c56
756e0b7
2061d0a
a3d8ad5
28119e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -326,20 +326,19 @@ class JobCancellationSuite extends SparkFunSuite with Matchers with BeforeAndAft | |
| // execution and a counter is used to make sure that the corresponding tasks are indeed | ||
| // cancelled. | ||
| import JobCancellationSuite._ | ||
| val numSlice = 2 | ||
| val numSlice = 1 | ||
| sc = new SparkContext(s"local[$numSlice]", "test") | ||
|
|
||
| val f = sc.parallelize(1 to 1000, numSlice).map { i => (i, i) } | ||
| .repartitionAndSortWithinPartitions(new HashPartitioner(2)) | ||
| .repartitionAndSortWithinPartitions(new HashPartitioner(numSlice)) | ||
| .mapPartitions { iter => | ||
| taskStartedSemaphore.release() | ||
|
||
| iter | ||
| }.foreachAsync { x => | ||
| if (x._1 >= 10) { | ||
| // This block of code is partially executed. It will be blocked when x._1 >= 10 and the | ||
| // next iteration will be cancelled if the source iterator is interruptible. Then in this | ||
| // case, the maximum num of increment would be 11(|1...10| + |N|) where N is the first | ||
| // element in another partition(assuming no ordering guarantee). | ||
| // case, the maximum num of increment would be 10(|1...10|) | ||
| taskCancelledSemaphore.acquire() | ||
| } | ||
| executionOfInterruptibleCounter.getAndIncrement() | ||
|
||
|
|
@@ -365,12 +364,12 @@ class JobCancellationSuite extends SparkFunSuite with Matchers with BeforeAndAft | |
| taskStartedSemaphore.acquire() | ||
|
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. why not
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. As soon as one task starts, we can cancel the job. |
||
| f.cancel() | ||
|
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. We should add some comment to explain when we reach here. From what I am seeing:
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. will do |
||
|
|
||
| val e = intercept[SparkException] { f.get() }.getCause | ||
| val e = intercept[SparkException](f.get()).getCause | ||
| assert(e.getMessage.contains("cancelled") || e.getMessage.contains("killed")) | ||
|
|
||
| // Make sure tasks are indeed completed. | ||
| taskCompletedSem.acquire(numSlice) | ||
| assert(executionOfInterruptibleCounter.get() <= 11) | ||
| assert(executionOfInterruptibleCounter.get() <= 10) | ||
| } | ||
|
|
||
| def testCount() { | ||
|
|
||
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.
can we hardcode it? using a variable makes people feel like they can change its value and the test can still pass, however it's not true as
assert(executionOfInterruptibleCounter.get() <= 10)needs to be updated too.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.
Will update it later.
But looks like Jenkins are having troubles there days? it it back to normal?
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.
I'm not sure, let's just try it :)