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

[HUDI-3645] fix NPE caused by multiple threads accessing non-thread-safe HashMap #5028

Merged
merged 7 commits into from
Mar 17, 2022

Conversation

fengjian428
Copy link
Contributor

Tips

What is the purpose of the pull request

When users use presto to query hudi tables. I found a NullPointerException seems caused by multiple threads accessing non-thread-safe HashMap. after changed to ConcurrentHashmap this error doesn't happen again

Brief change log

In HoodieROTablePathFilter change hoodiePathCache's type from Hashmap to ConcurrentHashmap

Verify this pull request

(Please pick either of the following options)

This pull request is a trivial rework / code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end.
  • Added HoodieClientWriteTest to verify the change.
  • Manually verified the change by running a job locally.

Committer checklist

  • Has a corresponding JIRA in PR title & commit

  • Commit message is descriptive of the change

  • CI is green

  • Necessary doc changes done or have another open PR

  • For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.

@hudi-bot
Copy link

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@nsivabalan nsivabalan added the priority:major degraded perf; unable to move forward; potential bugs label Mar 15, 2022
@nsivabalan
Copy link
Contributor

can we file a jira please

@fengjian428 fengjian428 changed the title fix NPE caused by multiple threads accessing non-thread-safe HashMap [HUDI-3645] fix NPE caused by multiple threads accessing non-thread-safe HashMap Mar 16, 2022
@fengjian428
Copy link
Contributor Author

can we file a jira please

https://issues.apache.org/jira/browse/HUDI-3645

@nsivabalan nsivabalan added priority:critical production down; pipelines stalled; Need help asap. and removed priority:major degraded perf; unable to move forward; potential bugs labels Mar 16, 2022
Copy link
Contributor

@yihua yihua left a comment

Choose a reason for hiding this comment

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

LGTM. @codope do you see any problem of using ConcurrentHashMap here for Presto?

Copy link
Member

@codope codope left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@codope codope merged commit bf191f8 into apache:master Mar 17, 2022
vingov pushed a commit to vingov/hudi that referenced this pull request Apr 3, 2022
…afe HashMap (apache#5028)

- Change HashMap in HoodieROTablePathFilter to ConcurrentHashMap
stayrascal pushed a commit to stayrascal/hudi that referenced this pull request Apr 12, 2022
…afe HashMap (apache#5028)

- Change HashMap in HoodieROTablePathFilter to ConcurrentHashMap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:critical production down; pipelines stalled; Need help asap.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants