Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16340#discussion_r93125739
  
    --- Diff: 
core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeSorterSpillReader.java
 ---
    @@ -94,6 +97,14 @@ public boolean hasNext() {
     
       @Override
       public void loadNext() throws IOException {
    +    // Kill the task in case it has been marked as killed. This logic is 
from
    +    // InterruptibleIterator, but we inline it here instead of wrapping 
the iterator in order
    +    // to avoid performance overhead. This check is added here in 
`loadNext()` instead of in
    +    // `hasNext()` because it's technically possible for the caller to be 
relying on
    +    // `getNumRecords()` instead of `hasNext()` to know when to stop.
    +    if (taskContext != null && taskContext.isInterrupted()) {
    --- End diff --
    
    TaskContext can be null in case this is used on the driver outside of the 
context of a specific task.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to