Commit Graph

373 Commits

Author SHA1 Message Date
Brian Tiger Chow
eb8db2ec79 log(gcr/s,c) add addtional eventlogs 2015-02-14 14:13:55 -08:00
Brian Tiger Chow
4a9ae80791 fix(gcr/c) print a loud error when clients receive routing messages, but don't panic
This is an unhandled case. Right now, we close the stream without
reading. Should clients be able to satisfy routing requests?

@jbenet @whyrusleeping
2015-02-14 14:13:54 -08:00
Brian Tiger Chow
d5331e7dc7 feat(gcr/s) add eventlogs 2015-02-14 14:13:54 -08:00
Brian Tiger Chow
9e5b3b7773 refactor(gcr/c) pass host.Host into GCR client 2015-02-14 14:13:54 -08:00
Brian Tiger Chow
ea9ea79459 feat(gcr/c) randomize order of remotes 2015-02-14 14:13:54 -08:00
Brian Tiger Chow
46bbd11e6b fix(gcr/s,c) register stream handlers 2015-02-14 14:13:54 -08:00
Brian Tiger Chow
d80e9aba7a feat(gcr/c) add support for multiple servers 2015-02-14 14:13:54 -08:00
Brian Tiger Chow
f8f4dc8e8d misc(gcr/c) rm TODO 2015-02-14 14:13:54 -08:00
Brian Tiger Chow
0721a58934 fix(gcr/s) proto marshaling bugs 2015-02-14 14:13:54 -08:00
Brian Tiger Chow
a88621aeb1 refac(gcr/s,c) remove network/dialer
remove dialer from GCR client
2015-02-14 14:13:53 -08:00
Brian Tiger Chow
c989646791 refac(gcr/s,c) use PeerRoutingInfo 2015-02-14 14:13:53 -08:00
Jeromy
066ebda687 a few more cleanup changes to handlers 2015-02-13 08:29:10 +00:00
Jeromy
241e34267c this might solve all our problems 2015-02-13 08:08:30 +00:00
Juan Batiz-Benet
e92a33f442 routing/kbucket: cleaner "public" interface for bucket 2015-02-05 06:22:44 -08:00
Juan Batiz-Benet
be2be853c7 kbucket: fix data race 2015-02-05 04:53:23 -08:00
Juan Batiz-Benet
d8a5bd0549 dht/query: make sure to cancel all contexts.
We are leaking peer queues:

http://gateway.ipfs.io/ipfs/QmQxVA48CzVwwNYExUiFe56VrUBn8u368ZfchnCLoc7fSC/moriarty
2015-02-03 12:19:17 -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
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
18ceb73efc dht: use our most recent Addrs 2015-02-02 21:04:13 -08:00
Brian Tiger Chow
2968221603 log(dht/pb) include key in dht message loggable 2015-02-01 22:08:49 -08:00
Brian Tiger Chow
35a5fa6f6f feat(dht/message) add PeerRoutingInfo 2015-02-01 21:54:19 -08:00
Juan Batiz-Benet
a2e3ea6236 dht/notif: bugfix in hanging connects
http://gifs.gifbin.com/012011/1295375531_cat-jump-fail.gif
2015-02-01 04:29:32 -08:00
Juan Batiz-Benet
d0432f9e75 dht: removing addrs sanity check
About to allow dht to start without local addresses. this is
so that we can initialize the dht and sign it up to listen
on the muxer, before our node starts accepting incoming connections.
otherwise, we lose some (we're observing this happening already).

I looked through the dht's use of the peerstore, and the check here
doesnt seem to be as important as the panic implies. I believe the
panic was used for debugging weird "dont have any address" conditions
we had earlier.
2015-01-30 20:37:52 -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
Brian Tiger Chow
25b1d34ae0 log(dht): remove lots of query debug logs
the debug log is flooded with pages upon pages of...

we've gotta be more judicious with our use of console logs. i'm sure
there's interesting actionable information in here. let's use the
console logging more like a sniper rifle and less like birdshot.

feel free to revert if there are specific critical statements in this
changeset

03:05:24.096 DEBUG        dht: dht(<peer.ID
QmWGN3>).Query(QmXvrpUZXCYaCkf1jfaQTJASS91xd47Yih2rnVC5YbFAAK).Run(3)
queryPeer(<peer.ID QmSoLp>) QUERY worker for: <peer.ID QmSoLp> - not
found, and no closer peers. prefixlog.go:107
03:05:24.096 DEBUG        dht: dht(<peer.ID
QmWGN3>).Query(QmXvrpUZXCYaCkf1jfaQTJASS91xd47Yih2rnVC5YbFAAK).Run(3)
queryPeer(<peer.ID QmSoLp>) completed prefixlog.go:107
03:05:24.096 DEBUG        dht: dht(<peer.ID
QmWGN3>).Query(QmXvrpUZXCYaCkf1jfaQTJASS91xd47Yih2rnVC5YbFAAK).Run(3)
queryPeer(<peer.ID QmSoLp>) finished prefixlog.go:107
03:05:24.096 DEBUG        dht: dht(<peer.ID QmWGN3>)
FindProviders(QmXvrpUZXCYaCkf1jfaQTJASS91xd47Yih2rnVC5YbFAAK)
Query(<peer.ID QmSoLn>) 0 provider entries prefixlog.go:107
03:05:24.096 DEBUG        dht: dht(<peer.ID QmWGN3>)
FindProviders(QmXvrpUZXCYaCkf1jfaQTJASS91xd47Yih2rnVC5YbFAAK)
Query(<peer.ID QmSoLn>) 0 provider entries decoded prefixlog.go:107
03:05:24.096 DEBUG        dht: dht(<peer.ID QmWGN3>)
FindProviders(QmXvrpUZXCYaCkf1jfaQTJASS91xd47Yih2rnVC5YbFAAK)
Query(<peer.ID QmSoLn>) got closer peers: 0 [] prefixlog.go:107
03:05:24.097 DEBUG        dht: dht(<peer.ID QmWGN3>)
FindProviders(QmXvrpUZXCYaCkf1jfaQTJASS91xd47Yih2rnVC5YbFAAK)
Query(<peer.ID QmSoLn>) end prefixlog.go:107
03:05:24.097 DEBUG        dht: dht(<peer.ID
QmWGN3>).Query(QmXvrpUZXCYaCkf1jfaQTJASS91xd47Yih2rnVC5YbFAAK).Run(3)
queryPeer(<peer.ID QmSoLn>) query finished prefixlog.go:107
03:05:24.097 DEBUG        dht: dht(<peer.ID
QmWGN3>).Query(QmXvrpUZXCYaCkf1jfaQTJASS91xd47Yih2rnVC5YbFAAK).Run(3)
queryPeer(<peer.ID QmSoLn>) QUERY worker for: <peer.ID QmSoLn> - not
found, and no closer peers. prefixlog.go:107
03:05:24.097 DEBUG        dht: dht(<peer.ID
QmWGN3>).Query(QmXvrpUZXCYaCkf1jfaQTJASS91xd47Yih2rnVC5YbFAAK).Run(3)
queryPeer(<peer.ID QmSoLn>) completed prefixlog.go:107
03:05:24.097 DEBUG        dht: dht(<peer.ID
QmWGN3>).Query(QmXvrpUZXCYaCkf1jfaQTJASS91xd47Yih2rnVC5YbFAAK).Run(3)
queryPeer(<peer.ID QmSoLn>) finished prefixlog.go:107
03:05:24.097 DEBUG        dht: dht(<peer.ID
QmWGN3>).Query(QmXvrpUZXCYaCkf1jfaQTJASS91xd47Yih2rnVC5YbFAAK).Run(3)
all peers ended prefixlog.go:107
03:05:24.097 DEBUG        dht: dht(<peer.ID
QmWGN3>).Query(QmXvrpUZXCYaCkf1jfaQTJASS91xd47Yih2rnVC5YbFAAK).Run(3)
spawnWorkers end prefixlog.go:107
03:05:24.097 DEBUG        dht: dht(<peer.ID
QmWGN3>).Query(QmXvrpUZXCYaCkf1jfaQTJASS91xd47Yih2rnVC5YbFAAK).Run(3)
failure: %s routing: not found prefixlog.go:107
03:05:24.097 DEBUG        dht: dht(<peer.ID
QmWGN3>).Query(QmXvrpUZXCYaCkf1jfaQTJASS91xd47Yih2rnVC5YbFAAK).Run(3)
end prefixlog.go:107
2015-01-30 06:57:41 -08:00
Brian Tiger Chow
577baaf621 feat(routing.grandcentral): skeleton
fixes breakages:
  - peer.Peer -> peer.ID
  - peer.X -> peer.PeerInfo
  - netmsg -> p2p streams
2015-01-27 02:32:06 -08:00
Juan Batiz-Benet
45e4352c9c dropped down log.Errors 2015-01-26 19:13:44 -08:00
Jeromy
739b19115b correct notifications for findProviders 2015-01-25 01:41:06 +00: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
66503701ac dht: TestConnectCollision skip in Travis
+ longer timeout
2015-01-24 10:34:28 -08:00
Juan Batiz-Benet
8037235c6d disable dht TestPeriodicBootstrap on CI 2015-01-24 10:30:15 -08:00
Juan Batiz-Benet
0bd63633d5 dht/kbucket: race condition fix 2015-01-24 10:22:56 -08:00
Juan Batiz-Benet
00d7b498ef routing/dht: adjust routing table on peer conn/disc 2015-01-24 09:13:44 -08:00
Brian Tiger Chow
6fedf259eb remove prefix logger 2015-01-24 00:30:56 -08:00
Jeromy
d68efad06c respect verbose option a bit, and show query events for other commands 2015-01-24 05:32:50 +00:00
Jeromy
56a5e72760 implement dht findprovs and add error output to dht query 2015-01-24 03:56:46 +00:00
Juan Batiz-Benet
e65afaf198 dont rate limit query during dials 2015-01-24 03:56:46 +00:00
Jeromy
528eb5a55a use a notification type strategy for the query events 2015-01-24 03:56:45 +00:00
Jeromy
ec5276c29c really ugly impl of 'ipfs dht query' command 2015-01-24 03:56:45 +00:00
Juan Batiz-Benet
4a5f5e2e2b reprovide: wait a minute before reproviding
Many times, a node will start up only to shut down immediately.
In these cases, reproviding is costly to both the node, and the
rest of the network. Also note: the probability of a node being
up another minute increases with uptime.

TODO: maybe this should be 5 * time.Minute
2015-01-23 05:25:32 -08:00
Juan Batiz-Benet
95d58b2a4a core: cleaned up bootstrap process 2015-01-23 05:25:31 -08:00
Juan Batiz-Benet
dd9c1b6243 core/bootstrap: CR comments 2015-01-23 02:08:30 -08:00
Juan Batiz-Benet
d6ce837d72 core/bootstrap: cleaned up bootstrapping
Moved it to its own package to isolate scope.
2015-01-23 02:08:29 -08:00
Juan Batiz-Benet
5259cf06d6 dht: kick off all the queries wit every node in our rt
s/kademlia calls for makign sure to query all peers we
have in our routing table, not just those closest. this
helps ensure most queries resolve properly.
2015-01-23 02:08:29 -08:00
Juan Batiz-Benet
486536149e dht/query: err return NotFound case
When some queries finished, but we got no result, it should
be a simple NotFoundError. Only when every single query ended
in error do we externalize those to the client, in case
something major is going wrong
2015-01-23 02:08:29 -08:00
Juan Batiz-Benet
9cd975ce36 dht/bootstrap: timeout queries 2015-01-23 02:08:29 -08:00
Juan Batiz-Benet
1493c9d80a dht/bootstrap: logging 2015-01-23 02:08:29 -08:00
Juan Batiz-Benet
8966743ebd try less aggressive bootstrap 2015-01-23 02:08:28 -08:00
Juan Batiz-Benet
82d38a2692 routing/dht: periodic bootstrapping #572 2015-01-23 02:08:28 -08:00
Brian Tiger Chow
494ed8fb0d demote dht logs 2015-01-20 23:43:21 -08:00