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

cluster: safeguard consensus not set when calling ID #238

Merged
merged 3 commits into from Nov 15, 2017

Conversation

hsanjuan
Copy link
Collaborator

SwarmConnect on the ipfs connector calls rpc Peers() which
requests IDs for every peer member. If that peer member
is booting, it might get the request after RPC is setup
but before consensus is initialized. In which case
a panic happens. Probability that this happens is small, but still.

Also increase the connect swarms delay to 30 seconds, which
should be a bit longer than the default wait_for_leader timeout,
otherwise we might connect swarms while there's not even a leader.

License: MIT
Signed-off-by: Hector Sanjuan hector@protocol.ai

@hsanjuan hsanjuan self-assigned this Nov 15, 2017
@ghost ghost added the status/in-progress In progress label Nov 15, 2017
SwarmConnect on the ipfs connector calls rpc Peers() which
requests IDs for every peer member. If that peer member
is booting, it might get the request after RPC is setup
but before consensus is initialized. In which case
a panic happens. Probability that this happens is small, but still.

Also increase the connect swarms delay to 30 seconds, which
should be a bit longer than the default wait_for_leader timeout,
otherwise we might connect swarms while there's not even a leader.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 74.141% when pulling a656e45 on fix/start-panic into a1f1ef1 on master.

ZenGround0
ZenGround0 previously approved these changes Nov 15, 2017
Copy link
Collaborator

@ZenGround0 ZenGround0 left a comment

Choose a reason for hiding this comment

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

LGTM

@hsanjuan
Copy link
Collaborator Author

sorry @ZenGround0 , just added something to fix the test that failed (which is not related, and randomly fails, but still)... so you need to re-approve

make sure we save a new config if the new peerset
is different than the one in the configuration at
boot.

Hopefully this fixes a race condition in PeerAdd test

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
ZenGround0
ZenGround0 previously approved these changes Nov 15, 2017
Copy link
Collaborator

@ZenGround0 ZenGround0 left a comment

Choose a reason for hiding this comment

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

No worries

Use it to find out the number of peers in the config and prevent
peerAdd test failures.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 74.07% when pulling 081384f on fix/start-panic into a1f1ef1 on master.

@hsanjuan
Copy link
Collaborator Author

@ZenGround0 look at all that greenness :) thanks again!

Copy link
Collaborator

@ZenGround0 ZenGround0 left a comment

Choose a reason for hiding this comment

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

LGTM

@hsanjuan hsanjuan merged commit 1d67cb3 into master Nov 15, 2017
@ghost ghost removed the status/in-progress In progress label Nov 15, 2017
@hsanjuan hsanjuan deleted the fix/start-panic branch November 15, 2017 19:48
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