Skip to content

Commit d1e0b7f

Browse files
[management] get peer groups without lock (#4280)
1 parent beb6620 commit d1e0b7f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

management/server/ephemeral_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ func (a *MockAccountManager) DeletePeer(_ context.Context, accountID, peerID, us
4343
a.mu.Lock()
4444
defer a.mu.Unlock()
4545
a.deletePeerCalls++
46+
delete(a.store.account.Peers, peerID)
4647
if a.wg != nil {
4748
a.wg.Done()
4849
}
49-
delete(a.store.account.Peers, peerID)
5050
return nil
5151
}
5252

management/server/peer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,7 @@ func (am *DefaultAccountManager) getInactivePeers(ctx context.Context, accountID
15251525

15261526
// GetPeerGroups returns groups that the peer is part of.
15271527
func (am *DefaultAccountManager) GetPeerGroups(ctx context.Context, accountID, peerID string) ([]*types.Group, error) {
1528-
return am.Store.GetPeerGroups(ctx, store.LockingStrengthShare, accountID, peerID)
1528+
return am.Store.GetPeerGroups(ctx, store.LockingStrengthNone, accountID, peerID)
15291529
}
15301530

15311531
// getPeerGroupIDs returns the IDs of the groups that the peer is part of.

0 commit comments

Comments
 (0)