Skip to content

Avoid config change to be lost.#36

Merged
greensky00 merged 2 commits intoeBay:masterfrom
shigui1989:shigui1989
Aug 30, 2019
Merged

Avoid config change to be lost.#36
greensky00 merged 2 commits intoeBay:masterfrom
shigui1989:shigui1989

Conversation

@shigui1989
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
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