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

Speedup shutdown #2862

Merged
merged 1 commit into from
May 30, 2019
Merged

Conversation

hashmap
Copy link
Contributor

@hashmap hashmap commented May 29, 2019

I made an suboptimal (aka stupid) decision to stop and wait for peers
one by one which makes shutdown very slow - O(n). This PR decouples sending
stop signal from waiting a thread to exit. On top of it in Peers we
first send stop signal to all peers and only after that start waiting
for them to exit. It gives us a constant time of shutdown in most of the
cases.

I made an suboptimal (aka stupid) decision to stop and wait for peers
one by one which makes shutdown very slow - O(n). This PR decouples sending
stop signal from waiting a thread to exit. On top of it in Peers we
first send stop signal to all peers and only after that start waiting
for them to exit. It gives us a constant time of shutdown in most of the
cases.
@hashmap hashmap added this to the 1.1.0 milestone May 29, 2019
@garyyu
Copy link
Contributor

garyyu commented May 30, 2019

Thanks for finding this 👍

It happened several times when I kill the process, but I didn't realize it's a new "bug" :-) I thought sth was wrong in my system and just use kill -9.

@garyyu garyyu merged commit 2863ed6 into mimblewimble:master May 30, 2019
@antiochp antiochp added the release notes To be included in release notes (of relevant milestone). label Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes To be included in release notes (of relevant milestone).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants