Skip to content

Commit fda3064

Browse files
committed
[FAB-2689] Limit conn attempts to bootstrap peers
In gossip, when a peer starts up- it tries to connect to the bootstrap set indefinitely. This needs to be limited up to a finite number. Change-Id: I9a0e8290dbda5489325aa4ce3c0b2f33122b252b Signed-off-by: Yacov Manevich <[email protected]>
1 parent 1f5bc46 commit fda3064

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gossip/discovery/discovery_impl.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func (d *gossipDiscoveryImpl) connect2BootstrapPeers(endpoints []string) {
179179
return
180180
}
181181

182-
for !d.somePeerIsKnown() {
182+
for i := 0; i < maxConnectionAttempts && !d.somePeerIsKnown() && !d.toDie(); i++ {
183183
var wg sync.WaitGroup
184184
req := d.createMembershipRequest(true).NoopSign()
185185
wg.Add(len(endpoints))

0 commit comments

Comments
 (0)