Unverified Commit 9b0d9400 authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #40 from libp2p/fix/dial-timeout

don't pass the dial timeout option
parents 8261d64a 8781a6c9
2.0.5: QmdQFrFnPrKRQtpeHKjZ3cVNwxmGKKS2TvhJTuN9C9yduh 2.1.0: QmcnHXGwX6Yfqm7guiAjCujXg7RugKSaV1wj8RH2NTpNKK
...@@ -6,7 +6,7 @@ os: ...@@ -6,7 +6,7 @@ os:
language: go language: go
go: go:
- 1.8 - 1.9
install: true install: true
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
"gxDependencies": [ "gxDependencies": [
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
"hash": "QmNa31VPzC561NWwRsJLE7nGYZYuuD2QfpK2b1q9BK54J1", "hash": "QmbD5yKbXahNvoMqzeuNyKQA9vAs9fUvJg2GXeWU1fVqY5",
"name": "go-libp2p-net", "name": "go-libp2p-net",
"version": "2.0.0" "version": "2.0.2"
}, },
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
}, },
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
"hash": "QmQVm7pWYKPStMeMrXNRpvAJE5rSm9ThtQoNmjNHC7sh3k", "hash": "Qme2XMfKbWzzYd92YvA1qnFMe3pGDR86j5BcFtx4PwdRvr",
"name": "go-libp2p-transport", "name": "go-libp2p-transport",
"version": "2.2.8" "version": "2.2.9"
}, },
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
...@@ -57,9 +57,9 @@ ...@@ -57,9 +57,9 @@
}, },
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
"hash": "QmdicniYXy49AFCSVTZeYmo997kT5XJRzZLokzJCrywR2U", "hash": "QmUE6HHybkvTDUkP6gHx41XNHsyZDwxCmxiD2fJABsg9eZ",
"name": "go-ws-transport", "name": "go-ws-transport",
"version": "1.6.1" "version": "1.6.2"
}, },
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
...@@ -69,27 +69,27 @@ ...@@ -69,27 +69,27 @@
}, },
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
"hash": "QmXZYkfBN1cABhBZRaEwLzgEB5B3nAGiJYCmhWbDW3cDus", "hash": "QmfT8oJ8o8AY417RNu1bUYsnDPipPHSCdVcWjYRsDNFL4M",
"name": "go-peerstream", "name": "go-peerstream",
"version": "2.1.0" "version": "2.1.1"
}, },
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
"hash": "QmQbh3Rb7KM37As3vkHYnEFnzkVXNCP8EYGtHz6g2fXk14", "hash": "QmbXmeK6KgUAkbyVGRxXknupmWAHnt6ryghT8BFSsEh2sB",
"name": "go-libp2p-metrics", "name": "go-libp2p-metrics",
"version": "2.0.0" "version": "2.0.1"
}, },
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
"hash": "QmTi4629yyHJ8qW9sXFjvxJpYcN499tHhERLZYdUqwRU9i", "hash": "QmTmknvYRdCyzsgEKWqq3Q7E2aPDEwFR9cNqBpgyQ2mGet",
"name": "go-libp2p-conn", "name": "go-libp2p-conn",
"version": "1.6.13" "version": "1.7.0"
}, },
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
"hash": "QmbrUTiVDSK3WGePN18qVjpGYmvXQt6YVPyyGoXWx593uq", "hash": "QmTvzVdANd5UWYxEqV9czC9gPZX6k7BCSVYcz91Gwz6J7A",
"name": "go-tcp-transport", "name": "go-tcp-transport",
"version": "1.2.3" "version": "1.2.5"
}, },
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
...@@ -99,9 +99,9 @@ ...@@ -99,9 +99,9 @@
}, },
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
"hash": "QmfQAY7YU4fQi3sjGLs1hwkM2Aq7dxgDyoMjaKN4WBWvcB", "hash": "QmZD7kdgd6eiBCvNbyvsFQ11h3ainoCJpJRbecDx3CPcbZ",
"name": "go-libp2p-interface-conn", "name": "go-libp2p-interface-conn",
"version": "0.4.8" "version": "0.4.9"
}, },
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
...@@ -111,15 +111,15 @@ ...@@ -111,15 +111,15 @@
}, },
{ {
"author": "libp2p", "author": "libp2p",
"hash": "QmQq9YzmdFdWNTDdArueGyD7L5yyiRQigrRHJnTGkxcEjT", "hash": "QmauYrW3kDcfZwUuqjyDCSTyaicL8tvo3a7VkAVgAEes96",
"name": "go-libp2p-interface-pnet", "name": "go-libp2p-interface-pnet",
"version": "2.1.2" "version": "2.1.3"
}, },
{ {
"author": "whyrusleeping", "author": "whyrusleeping",
"hash": "QmVJGsPeK3vwtEyyTxpCs47yjBYMmYsAhEouPDF3Gb2eK3", "hash": "QmcNdF325V5LjhHowoZJvby7Y3xB7kNUMPj6Ve7VPzdQ9Z",
"name": "go-addr-util", "name": "go-addr-util",
"version": "1.2.2" "version": "1.2.3"
}, },
{ {
"hash": "QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52", "hash": "QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52",
...@@ -174,6 +174,6 @@ ...@@ -174,6 +174,6 @@
"license": "MIT", "license": "MIT",
"name": "go-libp2p-swarm", "name": "go-libp2p-swarm",
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"", "releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
"version": "2.0.5" "version": "2.1.0"
} }
...@@ -129,7 +129,7 @@ func NewSwarmWithProtector(ctx context.Context, listenAddrs []ma.Multiaddr, loca ...@@ -129,7 +129,7 @@ func NewSwarmWithProtector(ctx context.Context, listenAddrs []ma.Multiaddr, loca
local: local, local: local,
peers: peers, peers: peers,
ctx: ctx, ctx: ctx,
dialT: DialTimeout, dialT: conn.DialTimeout,
notifs: make(map[inet.Notifiee]ps.Notifiee), notifs: make(map[inet.Notifiee]ps.Notifiee),
transports: []transport.Transport{ transports: []transport.Transport{
tcpt.NewTCPTransport(), tcpt.NewTCPTransport(),
...@@ -164,7 +164,7 @@ func NewBlankSwarm(ctx context.Context, id peer.ID, privkey ci.PrivKey, pstpt ps ...@@ -164,7 +164,7 @@ func NewBlankSwarm(ctx context.Context, id peer.ID, privkey ci.PrivKey, pstpt ps
local: id, local: id,
peers: pstore.NewPeerstore(), peers: pstore.NewPeerstore(),
ctx: ctx, ctx: ctx,
dialT: DialTimeout, dialT: conn.DialTimeout,
notifs: make(map[inet.Notifiee]ps.Notifiee), notifs: make(map[inet.Notifiee]ps.Notifiee),
fdRateLimit: make(chan struct{}, concurrentFdDials), fdRateLimit: make(chan struct{}, concurrentFdDials),
Filters: filter.NewFilters(), Filters: filter.NewFilters(),
......
...@@ -48,11 +48,6 @@ const concurrentFdDials = 160 ...@@ -48,11 +48,6 @@ const concurrentFdDials = 160
// number of concurrent outbound dials to make per peer // number of concurrent outbound dials to make per peer
const defaultPerPeerRateLimit = 8 const defaultPerPeerRateLimit = 8
// DialTimeout is the amount of time each dial attempt has. We can think about making
// this larger down the road, or putting more granular timeouts (i.e. within each
// subcomponent of Dial)
var DialTimeout = time.Second * 10
// dialbackoff is a struct used to avoid over-dialing the same, dead peers. // dialbackoff is a struct used to avoid over-dialing the same, dead peers.
// Whenever we totally time out on a peer (all three attempts), we add them // Whenever we totally time out on a peer (all three attempts), we add them
// to dialbackoff. Then, whenevers goroutines would _wait_ (dialsync), they // to dialbackoff. Then, whenevers goroutines would _wait_ (dialsync), they
......
...@@ -20,7 +20,7 @@ func (s *Swarm) AddListenAddr(a ma.Multiaddr) error { ...@@ -20,7 +20,7 @@ func (s *Swarm) AddListenAddr(a ma.Multiaddr) error {
return fmt.Errorf("no transport for address: %s", a) return fmt.Errorf("no transport for address: %s", a)
} }
d, err := tpt.Dialer(a, transport.TimeoutOpt(DialTimeout), transport.ReusePorts) d, err := tpt.Dialer(a, transport.ReusePorts)
if err != nil { if err != nil {
return err return err
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment