Skip to content

Commit

Permalink
Merge pull request #459 from subutai-io/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
crioto authored Nov 23, 2017
2 parents 633d6b8 + df27f7a commit a21a5db
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

* Draft next version

## [6.2.3] 11/23/2017

* Forced usage of master dht

## [6.2.2] 11/20/2017

* Fixed connectivity issues
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.0-dev
6.2.3
24 changes: 23 additions & 1 deletion lib/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ func (p *PeerToPeer) FindNetworkAddresses() {

// StartP2PInstance is an entry point of a P2P library.
func StartP2PInstance(argIP, argMac, argDev, argDirect, argHash, argDht, argKeyfile, argKey, argTTL, argLog string, fwd bool, port int, ignoreIPs []string) *PeerToPeer {
// Master mode
argDht = "mdht.subut.ai:6881"
p := new(PeerToPeer)
p.Init()
p.Interface.Mac = p.validateMac(argMac)
Expand Down Expand Up @@ -267,7 +269,27 @@ func StartP2PInstance(argIP, argMac, argDev, argDirect, argHash, argDht, argKeyf
}
}()

p.StartDHT(p.Hash, p.Routers)
err = p.StartDHT(p.Hash, p.Routers)
if err != nil {
Log(Info, "Retrying DHT connection")
attempts := 0
for attempts < 3 {
err = p.StartDHT(p.Hash, p.Routers)
if err != nil {
Log(Info, "Another attempt failed")
attempts++
} else {
Log(Info, "Connection established")
err = nil
break
}
}
}
if err != nil {
Log(Error, "Failed to start instance due to problems with bootstrap node connection")
return nil
}

err = p.prepareInterfaces(argIP, interfaceName)
if err != nil {
return nil
Expand Down

0 comments on commit a21a5db

Please sign in to comment.