Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

fix: mutex deadlocks in PeerClient #223

Merged
merged 23 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 2 additions & 0 deletions functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,8 @@ func TestHealthCheck(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), clock.Second*15)
defer cancel()
require.NoError(t, cluster.Restart(ctx))
// wait for instances to come online
Baliedge marked this conversation as resolved.
Show resolved Hide resolved
time.Sleep(1 * time.Second)
}

func TestLeakyBucketDivBug(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion global.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type globalManager struct {
wg syncutil.WaitGroup
conf BehaviorConfig
log FieldLogger
instance *V1Instance // todo circular import? V1Instance also holds a reference to globalManager
instance *V1Instance // TODO circular import? V1Instance also holds a reference to globalManager
metricGlobalSendDuration prometheus.Summary
metricBroadcastDuration prometheus.Summary
metricBroadcastCounter *prometheus.CounterVec
Expand Down Expand Up @@ -261,6 +261,7 @@ func (gm *globalManager) broadcastPeers(ctx context.Context, updates map[string]
fan.Wait()
}

// Close stops all goroutines and shuts down all the peers.
func (gm *globalManager) Close() {
gm.wg.Stop()
for _, peer := range gm.instance.GetPeerList() {
Expand Down
Loading