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

[ARCTIC-1018][AMS] Avoiding concurrent operations by tasksLock #1022

Merged
merged 3 commits into from
Jan 29, 2023

Conversation

zhongqishang
Copy link
Contributor

Why are the changes needed?

Fix #1018

Brief change log

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before making a pull request

Documentation

  • Does this pull request introduces a new feature? (no)
  • If yes, how is the feature documented? (not applicable)

@github-actions github-actions bot added module:ams-server Ams server module module:ams-dashboard Ams dashboard module labels Jan 18, 2023
@zhoujinsong
Copy link
Contributor

@zhongqishang Thanks a lot for reporting the bug and providing this PR to fix it.
After I check the code, it seems tasksLock is responsible for protecting optimizeTasks from concurrent operations, so maybe we should surround the method checkTaskExecuteTimeout with tasksLock protection.

@wangtaohz How do you think?

@zhongqishang
Copy link
Contributor Author

@zhoujinsong
Sorry for I didn't have a detailed investigation, I think you are right.

Copy link
Contributor

@zhoujinsong zhoujinsong left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks a lot for your contribution!
cc @wangtaohz

@zhongqishang zhongqishang changed the title [ARCTIC-1018][AMS] LinkedHashMap modified to ConcurrentHashMap [ARCTIC-1018][AMS] Avoiding concurrent operations by tasksLock Jan 29, 2023
@zhoujinsong zhoujinsong merged commit 72691f1 into apache:master Jan 29, 2023
@zhongqishang zhongqishang deleted the ARCTIC-1018 branch April 19, 2023 07:50
zhoujinsong pushed a commit that referenced this pull request May 31, 2023
* [ARCTIC-1018][AMS] LinkedHashMap modified to ConcurrentHashMap

* Revert "[ARCTIC-1018][AMS] LinkedHashMap modified to ConcurrentHashMap"

This reverts commit 4b262fe.

* [ARCTIC-1018][AMS] Avoiding concurrent operations by `tasksLock`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:ams-dashboard Ams dashboard module module:ams-server Ams server module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: ConcurrentModificationException with LinkedHashMap
2 participants