Commit Graph

358 Commits

Author SHA1 Message Date
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
Juan Batiz-Benet
56ae2fd0a8 routing: record validation into record/
This commit moves the record validation/verification
from dht/ into the new record/ packaage. Validator object
-- which is merely a map of ValidatorFuncs -- with a
VerifyRecord

cc @whyrusleeping
2015-01-19 08:10:37 +00:00
Jeromy
c01452e5ea move dht record code into new package 2015-01-19 08:07:58 +00:00
Jeromy
a5233faeae some comments 2015-01-19 08:06:51 +00:00
Jeromy
feeada0d90 fix fuse mounting issues
this time, without loading the private key on every startup
2015-01-19 08:05:52 +00: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
c057cea649 addr-explosion mitigated adding
mitigated adding our own addresses where received
from peers

see #573
2015-01-16 11:38:46 -08:00
Jeromy
6bfb9d838c remove low signal log messages 2015-01-15 22:01:33 +00:00
Jeromy
7c9431ba23 add events for handlers 2015-01-15 17:47:36 +00:00
Jeromy
3c55902811 rewrite as single line defer logs 2015-01-15 04:45:34 +00:00
Jeromy
bae8b9f4c0 starting to move important events over to EventBegin/Done 2015-01-15 04:17:17 +00:00
Juan Batiz-Benet
7ec1a674e3 p2p/net/swarm: do not usre link local addrs 2015-01-12 19:15:02 -08:00
Jeromy
50c8561bdd add peer info after FindPeer RPC
fix ping test
2015-01-10 07:27:49 +00:00
Jeromy
566a86f5d4 Address PR comments and add in more user feedback 2015-01-10 07:27:48 +00:00
Brian Tiger Chow
069966d55a ping WIP
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Conflicts:
	core/commands/root.go

begin ping command, WIP

finish initial ping implementation
2015-01-10 07:27:45 +00:00
Juan Batiz-Benet
1d9977c850 dht/bootstrap/test: longer timeout, less bias 2015-01-05 07:19:07 -08:00