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

Avoid config change to be lost. #36

Merged
merged 2 commits into from
Aug 30, 2019
Merged

Conversation

shigui1989
Copy link
Contributor

No description provided.

p_in( "Try to add server %d. But now there is a "
"un-committed config change. Should wait. "
"Count: %d.", srv_to_join_->get_id(), count++);
std::this_thread::sleep_for
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @shigui1989 , sleeping inside Asio worker threads looks to me not good.

How about maintaining intermediate_config_ separate to config_? That contains the latest config that is not committed yet. And we make new_conf based on that intermediate_config_, not config_. Also we need to update intermediate_config_ properly here, and clear it in reconfigure() function maybe. Then we can avoid the situation that multiple uncommitted configs overwrite each other.

Please let me know if you want to make this change by yourself, or I can do it on this PR. Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. You can help. Please go ahead! Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks

@greensky00 greensky00 merged commit 81472da into eBay:master Aug 30, 2019
alesapin added a commit to alesapin/NuRaft that referenced this pull request Jan 22, 2022
…atch

Fix bug which lead to memory leak

(cherry picked from commit 1707a75)
greensky00 pushed a commit that referenced this pull request Jan 26, 2022
…#278)

Fix bug which lead to memory leak

(cherry picked from commit 1707a75)
JackyWoo pushed a commit to JackyWoo/NuRaft that referenced this pull request Sep 30, 2022
xiaoxichen pushed a commit to xiaoxichen/NuRaft that referenced this pull request Jan 16, 2024
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