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

Bugfix: concurrent map writes #95

Merged
merged 7 commits into from
Nov 13, 2023

Conversation

powerfooI
Copy link
Collaborator

@powerfooI powerfooI commented Nov 13, 2023

Summary

  • OBServer controller has 9 concurrent reconciles at most, so it's possible that two go routines reconcile observer at the same time. When the two (or more) go routines write keys in task map in TaskManager which has no guarding Lock, program crashes.

Solution Description

  1. Change maps used in TaskManager from standard map to sync.Map, which is thread-safe.
  2. Fix GlobalWhiteList used in OBTenantManager by the way.

Copy link
Member

@chris-sun-star chris-sun-star left a comment

Choose a reason for hiding this comment

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

LGTM

@chris-sun-star chris-sun-star merged commit f0304c9 into oceanbase:2.0.x_dev Nov 13, 2023
2 checks passed
chris-sun-star added a commit that referenced this pull request Nov 13, 2023
* fix(concurrency): fix task manager concurrent problem, and some other fixes
@powerfooI powerfooI deleted the fix/concurrency branch November 14, 2023 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants