Skip to content
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-27558][CORE] Gracefully cleanup task when it fails with OOM exception #26606

Closed
wants to merge 1 commit into from

Conversation

ayudovin
Copy link
Contributor

What changes were proposed in this pull request?

When a task fails with OOM exception, the UnsafeInMemorySorter.array could be null. In the meanwhile, the cleanupResources() on task completion would call UnsafeInMemorySorter.getMemoryUsage in turn, and that lead to another NPE thrown.

Why are the changes needed?

Check if array is null in UnsafeInMemorySorter.getMemoryUsage and it should help to avoid NPE.

Does this PR introduce any user-facing change?

No

How was this patch tested?

It was tested manually.

@SparkQA
Copy link

SparkQA commented Nov 20, 2019

Test build #4938 has finished for PR 26606 at commit c151dd8.

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

Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

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

Looks fine as a backport.

@srowen
Copy link
Member

srowen commented Nov 21, 2019

Merged to 2.4

@srowen srowen closed this Nov 21, 2019
srowen pushed a commit that referenced this pull request Nov 21, 2019
…ception

### What changes were proposed in this pull request?
When a task fails with OOM exception, the UnsafeInMemorySorter.array could be null. In the meanwhile, the cleanupResources() on task completion would call UnsafeInMemorySorter.getMemoryUsage in turn, and that lead to another NPE thrown.
### Why are the changes needed?
Check if array is null in UnsafeInMemorySorter.getMemoryUsage and it should help to avoid NPE.
### Does this PR introduce any user-facing change?
No
### How was this patch tested?
It was tested manually.

Closes #26606 from ayudovin/fix-npe-in-listener-2.4.

Authored-by: yudovin <artsiom.yudovin@profitero.com>
Signed-off-by: Sean Owen <sean.owen@databricks.com>
otterc pushed a commit to linkedin/spark that referenced this pull request Mar 22, 2023
…ception

When a task fails with OOM exception, the UnsafeInMemorySorter.array could be null. In the meanwhile, the cleanupResources() on task completion would call UnsafeInMemorySorter.getMemoryUsage in turn, and that lead to another NPE thrown.
Check if array is null in UnsafeInMemorySorter.getMemoryUsage and it should help to avoid NPE.
No
It was tested manually.

Closes apache#26606 from ayudovin/fix-npe-in-listener-2.4.

Authored-by: yudovin <artsiom.yudovin@profitero.com>
Signed-off-by: Sean Owen <sean.owen@databricks.com>

Ref: LIHADOOP-58062

RB=2549424
BUG=LIHADOOP-58062
G=spark-reviewers
R=mmuralid
A=mmuralid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants