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

fix: fix potential concurrent access on StorageElector::curr_leader_host #1234

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dyinnz
Copy link

@dyinnz dyinnz commented Feb 22, 2024

Changelog category

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

[fix](fix: fix potential concurrent access on StorageElector::curr_leader_host)

This is not a real bug. But curr_leader_host shall be protected by a mutex, while it is not acquired inside StorageElector::setRole().

@CLAassistant
Copy link

CLAassistant commented Feb 22, 2024

CLA assistant check
All committers have signed the CLA.

@yuanzhubi
Copy link
Collaborator

Why it is needed? Only the bg_thread of the StorageElector object is enabled to update the role.

@dyinnz
Copy link
Author

dyinnz commented Feb 23, 2024

Why it is needed? Only the bg_thread of the StorageElector object is enabled to update the role.

yes, this is not needed in fact. Your word is correct, but other coders would not get the point at once after reading the piece of codes, which I mean, may need some logical inference. Or you could comment some notes on the curr_leader_host accessing where lacked lock protection.

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.

None yet

3 participants