diff --git a/.circleci/config.yml b/.circleci/config.yml index be0762b91073489aebb82708002a04c87a80990c..3b31955f20fdad2dcbb3249afaa8fb65d8c72b7e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,7 +12,7 @@ workflows: - ci-go/test: race: true name: "ci-go/test/race" - - ci-go/benchmark: - tolerance: 50 - requires: - - ci-go/test + #- ci-go/benchmark: + # tolerance: 50 + # requires: + # - ci-go/test diff --git a/internal/peermanager/peermanager.go b/internal/peermanager/peermanager.go index 4c489dd8af1a688505c7502bc098cfacd4dc9a2f..00857627cc3cfbb0f94e9a1aca67cf95dac77538 100644 --- a/internal/peermanager/peermanager.go +++ b/internal/peermanager/peermanager.go @@ -198,7 +198,7 @@ func (pm *PeerManager) getOrCreate(p peer.ID) PeerQueue { // RegisterSession tells the PeerManager that the given session is interested // in events about the given peer. -func (pm *PeerManager) RegisterSession(p peer.ID, s Session) bool { +func (pm *PeerManager) RegisterSession(p peer.ID, s Session) { pm.psLk.Lock() defer pm.psLk.Unlock() @@ -210,9 +210,6 @@ func (pm *PeerManager) RegisterSession(p peer.ID, s Session) bool { pm.peerSessions[p] = make(map[uint64]struct{}) } pm.peerSessions[p][s.ID()] = struct{}{} - - _, ok := pm.peerQueues[p] - return ok } // UnregisterSession tells the PeerManager that the given session is no longer diff --git a/internal/session/session.go b/internal/session/session.go index 7b2953f951e077b7680e0f913a105104283ace67..f2a4d2e4651fa07b9f2cefac82249c71ce2b196d 100644 --- a/internal/session/session.go +++ b/internal/session/session.go @@ -30,7 +30,7 @@ const ( type PeerManager interface { // RegisterSession tells the PeerManager that the session is interested // in a peer's connection state - RegisterSession(peer.ID, bspm.Session) bool + RegisterSession(peer.ID, bspm.Session) // UnregisterSession tells the PeerManager that the session is no longer // interested in a peer's connection state UnregisterSession(uint64) diff --git a/internal/session/session_test.go b/internal/session/session_test.go index 08bc9f88b397c0d48abb27b3b203fedc3aa25c9d..b63a20d9d7f40cb7ed3c5be4f5a3aa7462933cf4 100644 --- a/internal/session/session_test.go +++ b/internal/session/session_test.go @@ -136,9 +136,7 @@ func newFakePeerManager() *fakePeerManager { } } -func (pm *fakePeerManager) RegisterSession(peer.ID, bspm.Session) bool { - return true -} +func (pm *fakePeerManager) RegisterSession(peer.ID, bspm.Session) {} func (pm *fakePeerManager) UnregisterSession(uint64) {} func (pm *fakePeerManager) SendWants(context.Context, peer.ID, []cid.Cid, []cid.Cid) {} func (pm *fakePeerManager) BroadcastWantHaves(ctx context.Context, cids []cid.Cid) { diff --git a/internal/session/sessionwantsender_test.go b/internal/session/sessionwantsender_test.go index 806112f55f0d09619a064c951dcc1179d4ccda49..4b39a893fa0365e53b7560c82c031f9395680f76 100644 --- a/internal/session/sessionwantsender_test.go +++ b/internal/session/sessionwantsender_test.go @@ -59,12 +59,11 @@ func newMockPeerManager() *mockPeerManager { } } -func (pm *mockPeerManager) RegisterSession(p peer.ID, sess bspm.Session) bool { +func (pm *mockPeerManager) RegisterSession(p peer.ID, sess bspm.Session) { pm.lk.Lock() defer pm.lk.Unlock() pm.peerSessions[p] = sess - return true } func (pm *mockPeerManager) has(p peer.ID, sid uint64) bool { diff --git a/internal/sessionmanager/sessionmanager_test.go b/internal/sessionmanager/sessionmanager_test.go index fb8445f1e5d54136a5f0553678a09aa39e7158ff..db88855f559e1c202fccad5cf1d13725128a5076 100644 --- a/internal/sessionmanager/sessionmanager_test.go +++ b/internal/sessionmanager/sessionmanager_test.go @@ -64,7 +64,7 @@ type fakePeerManager struct { cancels []cid.Cid } -func (*fakePeerManager) RegisterSession(peer.ID, bspm.Session) bool { return true } +func (*fakePeerManager) RegisterSession(peer.ID, bspm.Session) {} func (*fakePeerManager) UnregisterSession(uint64) {} func (*fakePeerManager) SendWants(context.Context, peer.ID, []cid.Cid, []cid.Cid) {} func (*fakePeerManager) BroadcastWantHaves(context.Context, []cid.Cid) {}