Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

network: Kademlia Load Balancing #1774

Merged
merged 36 commits into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
0f31b5a
Proposed solution for peers load balancing in Kademlia
kortatu Sep 18, 2019
c1c9ac5
network: created global capabilityIndex
kortatu Sep 19, 2019
fc65d5a
typo
kortatu Sep 19, 2019
7dc9568
renamed globalIndex to defaultIndex
kortatu Sep 19, 2019
ca11c52
Load balancing capability test
kortatu Sep 20, 2019
97ab47e
Removed color balancing and using a KademliaLoadBalancer
kortatu Sep 25, 2019
f0fc99d
Missing file in commit
kortatu Sep 25, 2019
0941717
Merge branch 'master' into issue-1757
kortatu Sep 26, 2019
e9263d7
Fixed lint and test when mergin master
kortatu Sep 26, 2019
ed1f9a9
Subscription to peer changed closed only by writer, not by subscriptors
kortatu Sep 26, 2019
904e204
Added an alternative method for initializing a new peer count
kortatu Sep 27, 2019
29303f1
Merge branch 'master' into issue-1757
kortatu Sep 27, 2019
e53ae25
go fmt
kortatu Sep 27, 2019
f82db7f
extracted pubsub channel to a package
kortatu Sep 30, 2019
0e346e6
network: fixed pr comments
kortatu Oct 1, 2019
5665ea9
Merge branch 'master' into issue-1757
kortatu Oct 3, 2019
4c81a24
network/kademlia: Pr comments, tests commented and fixed
kortatu Oct 14, 2019
5b44ab3
network/kademlia: better naming for pub/sub channels in kademlialoadb…
kortatu Oct 14, 2019
52dacb0
Fixed wrong test in kademlia load balancer. Also fixed waiting methods.
kortatu Oct 15, 2019
3301920
Merge branch 'master' into issue-1757
kortatu Oct 15, 2019
49e7d09
Debug functions moved out of kademlialoadbalancer.go
kortatu Oct 15, 2019
ad5eac5
More comments, fixed EachConn po for peers in the same bin as the piv…
kortatu Oct 16, 2019
e78e2b3
resourceUseStats moved to a diffrente file. Use() renamed to AddUseCo…
kortatu Oct 16, 2019
21a0d2f
added gopubsub unit tests
kortatu Oct 29, 2019
c615cdd
Moved resource_use_stats to its own package. Renamed gopubsub to pubs…
kortatu Oct 29, 2019
340ce15
Pubsub now closes all go routines when closing. Removed commented code
kortatu Oct 29, 2019
96a8245
Merge branch 'master' into issue-1757
kortatu Oct 29, 2019
697b049
fix closing channel
kortatu Oct 29, 2019
5cb6d46
Added close channel for stopping blocked publishing goroutines
kortatu Oct 30, 2019
abc51ab
Added unit tests for pubsubchannel to check ongoing goroutines
kortatu Oct 30, 2019
9f951d1
Better accounting of pending messages/goroutines
kortatu Oct 30, 2019
d8f8059
Reverted metrics to regular int counters
kortatu Oct 30, 2019
c34062c
Removed testKademliaBackend, using testKademlia instead. Minor PR fixes
kortatu Oct 31, 2019
e7eefaf
PubSubChannel now publish messages semi-asynchronously filling first …
kortatu Nov 4, 2019
3019822
Exit publishing goroutine on psc.quitC close.
kortatu Nov 6, 2019
2879509
Avoid data race in getAllUseCounts
kortatu Nov 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions network/hive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func TestHiveStateConnections(t *testing.T) {

}
h1.Kademlia.lock.Lock()
numConns := h1.conns.Size()
numConns := h1.defaultIndex.conns.Size()
h1.Kademlia.lock.Unlock()
connAddresses := make(map[string]string)
h1.EachConn(h1.base, 255, func(peer *Peer, i int) bool {
Expand All @@ -271,12 +271,12 @@ func TestHiveStateConnections(t *testing.T) {
connsAfterLoading := 0
iterations := 0
h2.Kademlia.lock.Lock()
connsAfterLoading = h2.conns.Size()
connsAfterLoading = h2.defaultIndex.conns.Size()
h2.Kademlia.lock.Unlock()
for connsAfterLoading != numConns && iterations < 5 {
select {
case <-addedChan:
connsAfterLoading = h2.conns.Size()
connsAfterLoading = h2.defaultIndex.conns.Size()
case <-time.After(1 * time.Second):
iterations++
}
Expand Down
Loading