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 infinite loop when a peer is evicted from routing table and add cached peer #566

Merged
merged 9 commits into from Oct 15, 2019

Conversation

@limebell
Copy link
Contributor

limebell commented Oct 8, 2019

If a bucket is full, later peers who requested connection were cached into Bucket.ReplacementCache. If a peer is removed from a bucket then cached peer will be added automatically after liveness checking.

Previously, live check had a bug so check procedure repeats infinitely. This patch fixes such bug and added two test cases for the case and fixed one test case.

@limebell limebell added the bug label Oct 8, 2019
@limebell limebell added this to the 0.7.0 milestone Oct 8, 2019
@limebell limebell requested review from dahlia, longfin, earlbread and moreal Oct 8, 2019
@limebell limebell self-assigned this Oct 8, 2019
@limebell limebell force-pushed the limebell:bugfix-kademlia branch from 8710254 to bbfe4b6 Oct 8, 2019
@codecov

This comment has been minimized.

Copy link

codecov bot commented Oct 8, 2019

Codecov Report

Merging #566 into master will increase coverage by 0.15%.
The diff coverage is 87.14%.

@@            Coverage Diff             @@
##           master     #566      +/-   ##
==========================================
+ Coverage   90.59%   90.74%   +0.15%     
==========================================
  Files         202      202              
  Lines       15358    15514     +156     
==========================================
+ Hits        13913    14078     +165     
+ Misses       1155     1144      -11     
- Partials      290      292       +2
Impacted Files Coverage Δ
Libplanet/Net/Protocols/Kademlia.cs 94.11% <ø> (ø) ⬆️
Libplanet.Tests/Net/SwarmTest.cs 98.95% <100%> (+0.08%) ⬆️
Libplanet/Net/Swarm.cs 84.78% <55.88%> (-0.8%) ⬇️
Libplanet/Net/Protocols/KademliaProtocol.cs 66.49% <76.47%> (+6.76%) ⬆️
Libplanet/Net/Protocols/RoutingTable.cs 80.61% <0%> (+4.08%) ⬆️
@limebell limebell force-pushed the limebell:bugfix-kademlia branch from c827afe to d65c800 Oct 8, 2019
CHANGES.md Outdated Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
@limebell limebell force-pushed the limebell:bugfix-kademlia branch 2 times, most recently from cff9a4e to b04ad35 Oct 8, 2019
Copy link
Contributor

moreal left a comment

It seems to need to rebase.

@limebell limebell force-pushed the limebell:bugfix-kademlia branch 2 times, most recently from f8fd9cc to f40b40a Oct 14, 2019
@limebell limebell force-pushed the limebell:bugfix-kademlia branch from f40b40a to d00c73c Oct 15, 2019
@moreal
moreal approved these changes Oct 15, 2019
@dahlia
dahlia approved these changes Oct 15, 2019
@limebell limebell merged commit 953c36c into planetarium:master Oct 15, 2019
17 of 18 checks passed
17 of 18 checks passed
dist
Details
docs
Details
codecov/patch 87.14% of diff hit (target 90.59%)
Details
WIP Ready for review
Details
changelog This contains self-describing changelog.
Details
codecov/project 90.74% (+0.15%) compared to 79fcc1d
Details
license/cla Contributor License Agreement is signed.
Details
planetarium.libplanet Build #20191015.11 succeeded
Details
planetarium.libplanet (Linux_Mono) Linux_Mono succeeded
Details
planetarium.libplanet (Linux_NETCore) Linux_NETCore succeeded
Details
planetarium.libplanet (Windows_Mono) Windows_Mono succeeded
Details
planetarium.libplanet (Windows_NETCore) Windows_NETCore succeeded
Details
planetarium.libplanet (Windows_NETCore_Benchmark) Windows_NETCore_Benchmark succeeded
Details
planetarium.libplanet (Windows_NETCore_coverage) Windows_NETCore_coverage succeeded
Details
planetarium.libplanet (Windows_NETFramework) Windows_NETFramework succeeded
Details
planetarium.libplanet (macOS_Mono) macOS_Mono succeeded
Details
planetarium.libplanet (macOS_NETCore) macOS_NETCore succeeded
Details
planetarium.libplanet (macOS_Unity) macOS_Unity succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.