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

Hive: Avoid closing null writer in output committer abortTask #2150

Merged
merged 3 commits into from
Feb 3, 2021

Conversation

marton-bod
Copy link
Collaborator

In case we experience a failure during task commit (HiveIcebergOutputCommitter#commitTask), we'll have a problem during task abortion (HiveIcebergOutputCommitter#abortTask) because the committer has already removed its writer from the HiveIcebergRecordWriter's static map, therefore abortTask will run into NPE when dereferencing the writer.

To solve this, the commitTask should call Map#get instead of Map#remove initially, and only remove the reference from the map once it has successfully completed.

@github-actions github-actions bot added the MR label Jan 25, 2021
@pvary
Copy link
Contributor

pvary commented Jan 25, 2021

Can we have tests for this? (Like Mocked writer which throws an exception on close())

@rdblue rdblue merged commit a42df9e into apache:master Feb 3, 2021
@rdblue
Copy link
Contributor

rdblue commented Feb 3, 2021

Thanks, @marton-bod! And thanks for reviewing, @pvary!

@marton-bod
Copy link
Collaborator Author

Thanks for the merge, @rdblue, and @pvary for the review!

@pvary pvary added this to the Java 0.11.1 Release milestone Feb 18, 2021
aokolnychyi pushed a commit that referenced this pull request Mar 24, 2021
Co-authored-by: Marton Bod <mbod@cloudera.com>
coolderli pushed a commit to coolderli/iceberg that referenced this pull request Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants