Skip to content

Conversation

@colinmjj
Copy link

@colinmjj colinmjj commented Sep 4, 2019

What changes were proposed in this pull request?

If a Spark task is killed due to intentional job kills, automated killing of redundant speculative tasks, etc, ClosedByInterruptException occurs if task has unfinished I/O operation with AbstractInterruptibleChannel. A single cancelled task can result in hundreds of stack trace of ClosedByInterruptException being logged.
In this PR, stack trace of ClosedByInterruptException won't be logged like Executor.run do for InterruptedException.

Why are the changes needed?

Large numbers of spurious exceptions is confusing to users when they are inspecting Spark logs to diagnose other issues.

Does this PR introduce any user-facing change?

No

How was this patch tested?

N/A

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this second part meaningful? Maybe just ClosedByInterruptException while reverting partial writes to file" + file (i.e. keep the file name)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the interpolation. Should you name the exception here for clarity? In both cases you could log the exception message in the string here instead, to preserve some detail.

It'd be nice to avoid repeating the results.put(...) ; is this worth it?

case e: Exception =>
  e match {
     case ce: CloseByInterruptException => logError(...)
     case ex: Exception => logError(...)
  }
  results.put(...)
  return

…kObjectWriter: Uncaught exception while reverting partial writes to file: java.nio.channels.ClosedByInterruptException"
@colinmjj
Copy link
Author

colinmjj commented Sep 6, 2019

@srowen thanks for your comments, the pr is updated.

@colinmjj
Copy link
Author

colinmjj commented Sep 6, 2019

@jerryshao do you have any comment?

@jerryshao
Copy link
Contributor

ok to test.

@SparkQA
Copy link

SparkQA commented Sep 6, 2019

Test build #110234 has finished for PR 25674 at commit 6dac661.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen srowen closed this in dadb720 Sep 9, 2019
@srowen
Copy link
Member

srowen commented Sep 9, 2019

Merged to master

1 similar comment
@srowen
Copy link
Member

srowen commented Sep 9, 2019

Merged to master

PavithraRamachandran pushed a commit to PavithraRamachandran/spark that referenced this pull request Sep 15, 2019
### What changes were proposed in this pull request?

If a Spark task is killed due to intentional job kills, automated killing of redundant speculative tasks, etc, ClosedByInterruptException occurs if task has unfinished I/O operation with AbstractInterruptibleChannel. A single cancelled task can result in hundreds of stack trace of ClosedByInterruptException being logged.
In this PR, stack trace of ClosedByInterruptException won't be logged like Executor.run do for InterruptedException.

### Why are the changes needed?

Large numbers of spurious exceptions is confusing to users when they are inspecting Spark logs to diagnose other issues.

### Does this PR introduce any user-facing change?

No

### How was this patch tested?

N/A

Closes apache#25674 from colinmjj/spark-28340.

Authored-by: colinma <[email protected]>
Signed-off-by: Sean Owen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants