Commit Graph

49 Commits

Author SHA1 Message Date
Juan Batiz-Benet
10cd499a8b cmds/swarm connect had broken 2015-02-03 05:51:31 -08:00
Juan Batiz-Benet
58f39687cf logs: removed all log.Errors unhelpful to users
Let's save log.Error for things the user can take action on.
Moved all our diagnostics to log.Debug. We can ideally reduce them
even further.
2015-02-03 01:06:07 -08:00
Juan Batiz-Benet
6b4664fc8b p2p/net/swarm: permute addrs in rate limited dials
so that we dont get stuck dialing bad addrs first always.
2015-02-02 21:04:14 -08:00
Juan Batiz-Benet
793048d310 p2p/net/swarm: rate limit dials. max of 10 addrs at a time.
This will mitigate the fd explosion, but slow down dials majorly
as any peer with more addresses than the rate limit will have
to wait a whole dial timeout (~15s)
2015-02-02 21:04:14 -08:00
Juan Batiz-Benet
e908effb4b AddrManager: use addr manager with smarter TTLs
This addr manager should seriously help with the addrsplosion
problem.
2015-02-02 21:04:14 -08:00
Juan Batiz-Benet
98f2b0779f p2p/net: notify on listens
Network now signals when it successfully listens on some address
or when an address shuts down. This will be used to establish and
close nat port mappings. It could also be used to notify peers
of address changes.
2015-01-30 20:37:52 -08:00
Juan Batiz-Benet
df0967d6ee p2p/net: network interface Listen func
network interface now allows setting Listeners after the fact.
This is useful to create the network and start listening as
separate steps. And to keep the network up to date on new
addresses the node might have to listen to.
2015-01-30 06:51:29 -08:00
Juan Batiz-Benet
1ce3ecf846 swarm: TestSimultOpenMany has problems in CI.
dialing 4000 connections somehow keeps choking both travis and
jenkins. dialing this down to 500
2015-01-29 01:25:54 -08:00
Juan Batiz-Benet
81bb548d23 p2p/net/swarm: fix TestDialBackoff
- attempts set to 1 now.
- timeouts must account for that.
2015-01-28 15:49:54 -08:00
Juan Batiz-Benet
eb79770683 p2p/net: cleaned up dial events
+ fixed race
2015-01-28 02:15:32 -08:00
Juan Batiz-Benet
9dac5bb7d3 p2p/net: dial log -> events
This commit turns all dial logs into log.Events.

Everything's great except for one problem:
The LoggableMap I'm using does not print out things
correctly. I gave it peer.IDs, and Multiaddrs
and both got logged as nothing `{}` (didn't even call
their String() methods!) So, for now, this function
encodes it when called... This is wrong and should be
fixed before being merged in. Otherwise we  will be
constantly encoding peer.IDs and Multiaddrs without
needing to.

@briantigerchow how do you suggest doing this?
I don't know my way around your Loggable.
2015-01-27 01:35:37 -08:00
Juan Batiz-Benet
45e4352c9c dropped down log.Errors 2015-01-26 19:13:44 -08:00
Juan Batiz-Benet
76d9d89aff user friendliness in logs + output 2015-01-26 17:01:00 -08:00
Juan Batiz-Benet
6c6dcfce2b Merge pull request #640 from jbenet/races
more races 2015-01-24
2015-01-24 10:49:42 -08:00
Juan Batiz-Benet
a7bc7bd0e8 p2p/net/swarm: TestDialBackoffClears CI Timeout
increased the timeout for other CI too
2015-01-24 10:41:13 -08:00
Juan Batiz-Benet
4ae01e7a5e p2p/net/swarm: notifications 2015-01-24 09:13:44 -08:00
Brian Tiger Chow
6fedf259eb remove prefix logger 2015-01-24 00:30:56 -08:00
Juan Batiz-Benet
1ec8874077 p2p/net/swarm + conn: logs + debugerr output 2015-01-23 01:52:42 -08:00
Juan Batiz-Benet
10ae01f624 p2p/net/swarm/addr: check for nil addr 2015-01-23 01:46:56 -08:00
Juan Batiz-Benet
6de542b1eb p2p/net/conn: cleaner reuse port setup
This commit cleans up the reuse port setup, and fixes a problem:
make sure to filter addrs out that we simply cannot dial with
(e.g. loopback -> non-loopback, or linklocal -> nonlinklocal)
2015-01-19 23:18:52 -08:00
Brian Tiger Chow
884143bf9c move generic packages to thirdparty (see thirdparty/README.md) 2015-01-18 14:04:45 -08:00
Juan Batiz-Benet
0311c0518d testing/ci: all env var checks now use new pkgs
Good thing, i checked one wrong, too!
2015-01-14 16:01:03 -08:00
Juan Batiz-Benet
6959b4f032 p2p/net/swarm: fix travis env flag val
the travis docs say the env flag TRAVIS=true but, i want
to make absolutely sure. explicitness leaves less room for
error.
2015-01-13 23:34:28 -08:00
Juan Batiz-Benet
670b2b59b5 p2p/net/swarm: fix racey test 2015-01-13 22:46:41 -08:00
Juan Batiz-Benet
d9a815b3a0 p2p/net/swarm: nicer test timeouts for travis 2015-01-13 08:42:46 -08:00
Juan Batiz-Benet
1272bb6651 p2p/net/swarm: parallelize tests. poor travis. 2015-01-13 08:16:02 -08:00
Juan Batiz-Benet
baf2541237 p2p/net/swarm: extensive dial tests 2015-01-13 08:15:26 -08:00
Juan Batiz-Benet
7f3a651f5d p2p/net/swarm: sync diagram explain 2015-01-13 08:14:35 -08:00
Juan Batiz-Benet
f58276d6d2 p2p/net/swarm: async grabbing of best conn
this is actually pretty important in case some peers end
up changing addrs, so others dont fail dialing simply for
picking the wrong addr to start with.
2015-01-13 08:13:32 -08:00
Juan Batiz-Benet
9689b280e6 p2p/net/swarm: configurable timeout for tests 2015-01-13 08:12:45 -08:00
Juan Batiz-Benet
af889dc182 p2p/net/swrm: InterfaceListenAddrs now method 2015-01-13 05:58:49 -08:00
Juan Batiz-Benet
70ceaa975d p2p/net/swarm: dial backoff
This commit introduces a backoff when failing to dial
peers. It makes everything much faster.
2015-01-13 05:04:12 -08:00
Juan Batiz-Benet
8de8ed0842 p2p/net/swarm: dial timeout to 10s + dialer 2015-01-13 04:08:08 -08:00
Juan Batiz-Benet
5b4a3c09bd p2p/net/swarm: more connection bugs
* filtering InterfaceListenAddresses(s) instead
* return error if for loops skip
* large dial timeout
2015-01-13 03:32:15 -08:00
Juan Batiz-Benet
e3eaa154af p2p/net/swarm: fixed bugs in swarm err closes 2015-01-13 02:37:26 -08:00
Juan Batiz-Benet
8e888b1d79 p2p/net/swarm: dial adding conn note 2015-01-13 01:23:43 -08:00
Juan Batiz-Benet
25c6ab8a26 p2p/net/swarm: const dial attempts 2015-01-13 01:18:51 -08:00
Juan Batiz-Benet
90d654d55c p2p/net/swarm cleaned up dial sync 2015-01-13 00:24:38 -08:00
Juan Batiz-Benet
fcece3e32e p2p/net/swarm: dial once at a time 2015-01-12 22:14:23 -08:00
Juan Batiz-Benet
9b4d42f7b0 p2p/net/swarm: dial - filter out own addrs 2015-01-12 21:27:21 -08:00
Juan Batiz-Benet
7aa4a83f2e addr: proper filter + subtract 2015-01-12 20:49:06 -08:00
Juan Batiz-Benet
ddd5c4faee p2p/net/swarm: fix connect self problems
This adds two checks after a successful conn.Dial
* if the remote peer is not who we wanted, close conn
* if the remove peer is outselves, close conn

(the second is redundant, but the codebase may evolve to
end up disabling the first check, so keeping the second
in place helps)

note:
Loopback addresses are actually sent out (they _have to be_,
in cases where there are >1 node in the same machine), so
many times when trying connections, nodes end up dialing
themselves.
2015-01-12 20:17:54 -08:00
Juan Batiz-Benet
7ec1a674e3 p2p/net/swarm: do not usre link local addrs 2015-01-12 19:15:02 -08:00
Juan Batiz-Benet
711bb6a054 peers: was not setting the map...
cc @whyrusleeping
2015-01-12 11:20:57 -08:00
Juan Batiz-Benet
4e2431a0e4 p2p/net/swarm/listener: consume peerstream listeners 2015-01-11 12:55:33 -08:00
Juan Batiz-Benet
06299297c5 swarm addr checks 2015-01-09 06:22:27 -08:00
Juan Batiz-Benet
feb5e495f5 use ZeroLocalTCPAddress for network tests
This commit makes all network tests use ZeroLocalTCPAddress
as the initial peer address, and then relies on
net.ListenAddresses()

This should get rid of the tcp addr clash problems.
2015-01-02 08:46:46 -08:00
Juan Batiz-Benet
8fb5cf9578 swap net2 -> net 2015-01-02 08:46:46 -08:00
Juan Batiz-Benet
e2698a8733 net -> p2p/net
The net package is the next to move. It will be massaged
a bit still to fix the Network / "NetworkBackend" conflict.
2015-01-02 08:46:45 -08:00