Commit Graph

334 Commits

Author SHA1 Message Date
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
Brian Tiger Chow
195c2f3e28 log(bitswap) add message when message received 2015-02-01 22:08:49 -08:00
Brian Tiger Chow
800a3eb940 refactor(bitswap) move workers to bottom of file 2015-02-01 22:08:49 -08:00
Brian Tiger Chow
d9a8cfbd72 feat(bitswap) add deliverBlocks Event 2015-02-01 22:08:49 -08:00
Brian Tiger Chow
4ae02bc022 fix(bitswap) rename PeerToQuery to send wantlist
log(bitswap) remove ambiguous event
2015-02-01 22:08:49 -08:00
Brian Tiger Chow
a1fc5f9cf7 log(bitswap/message) make bsmsg loggable 2015-02-01 22:08:49 -08:00
Brian Tiger Chow
d78b76ddb4 log(bitswap) add bitswap loggable 2015-02-01 22:08:49 -08:00
Juan Batiz-Benet
29178e3c49 fix(bitswap/network/ipfs) ignore self as provider 2015-02-01 22:08:48 -08:00
Brian Tiger Chow
c114b04ae1 feat(bitswap): synchronous close 2015-02-01 21:54:19 -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
0ec0a6ab87 fix inflection 2015-01-30 06:57:41 -08:00
Brian Tiger Chow
6c2d799cb9 periodically print the number of keys in the wantlist (if any) 2015-01-30 06:57:41 -08:00
Brian Tiger Chow
49f2684c53 expose O(1) len 2015-01-30 06:57:41 -08:00
Brian Tiger Chow
351631a580 pass as param 2015-01-30 06:57:41 -08:00
Brian Tiger Chow
7e90fa95c9 log(bitswap): clean up 2015-01-30 06:57:41 -08:00
Juan Batiz-Benet
feb6d34134 bitswap/net: race fix in peers iteration 2015-01-29 01:16:45 -08:00
Juan Batiz-Benet
64191c1b31 bitswap: removed dubious error check test. 2015-01-29 01:10:01 -08:00
Juan Batiz-Benet
958cc61647 epictest: added test for bitswap wo routing 2015-01-28 23:55:30 -08:00
Brian Tiger Chow
afd3333cab optimization(bitswap) return connected peers as providers 2015-01-28 22:57:33 -08:00
Brian Tiger Chow
faded10870 fix(bitswap): handling of network notification 2015-01-24 11:34:30 -08:00
Brian Tiger Chow
bbc54516bf revert bitswap network notification
@jbenet @whyrusleeping
2015-01-24 11:47:28 -08:00
Juan Batiz-Benet
1054487690 bitswap: respond to peers connecting + disconnecting
With these notifications, bitswap can reclaim all resources
for any outstanding work for a peer.

cc @briantigerchow @whyrusleeping
2015-01-24 09:13:44 -08:00
Brian Tiger Chow
6fedf259eb remove prefix logger 2015-01-24 00:30:56 -08:00
Brian Tiger Chow
bb89e0d8d7 misc(bitswap): shorten comment and rename var 2015-01-21 17:09:40 -08:00
Brian Tiger Chow
2f247f3355 rm logging statements and inline send 2015-01-21 17:09:40 -08:00
Brian Tiger Chow
129d413f0e chore(bitswap): rm todo 2015-01-21 17:09:40 -08:00
Brian Tiger Chow
3d3ac08fcf chore(bitswap): rm debug log (covered by eventlog) 2015-01-21 17:09:39 -08:00
Brian Tiger Chow
aa4c0d1b90 fix(bitswap): release the lock last
The area above the lock was getting big. Moving this up to avoid
mistakes down the road.
2015-01-21 17:09:39 -08:00
Brian Tiger Chow
5985854099 fix: return pointer
@whyrusleeping
2015-01-19 03:08:05 -08:00
Brian Tiger Chow
60e288ed4b fix(bitswap.decision.Engine) enqueue only the freshest messages
Before, the engine worker would pop a task and block on send to the
bitswap worker even if the bitswap worker wasn't to receive. Since the
task could have been invalidated during this blocking send, a small
number of stale (already acquired) blocks would be send to partners.

Now, tasks are only popped off of the queue when bitswap is ready to
send them over the wire. This is accomplished by removing the
outboxChanBuffer and implementing a two-phase communication sequence.
2015-01-19 03:07:21 -08:00
Brian Tiger Chow
76bea9be0a move PQ to thirdparty 2015-01-18 15:09:54 -08:00
Brian Tiger Chow
61e4300d59 feat(PQ)
refactor: peerRequestQueue

	it's a mistake to make one queue to fit all. Go's lack of algebraic
	types turns a generalized queue into a monstrosity of type
	checking/casting. Better to have individual queues for individual
	purposes.

	Conflicts:
		exchange/bitswap/decision/bench_test.go
		exchange/bitswap/decision/tasks/task_queue.go

	fix(bitswap.decision.PRQ): if peers match, always return result of pri comparison

	fix(bitswap.decision.Engine): push to the queue before notifying

	TOCTOU bug

	1. client notifies
	2. worker checks (finds nil)
	3. worker sleeps
	3. client pushes (worker missed the update)

	test(PQ): improve documentation and add test

	test(bitswap.decision.Engine): handling received messages

	License: MIT
	Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2015-01-18 15:09:54 -08:00
Brian Tiger Chow
0239379303 tests: add bench
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2015-01-18 15:09:54 -08:00
Brian Tiger Chow
cb1ef6e1e2 feat: add time to taskQueue
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Conflicts:
	exchange/bitswap/decision/taskqueue.go
2015-01-18 15:09:54 -08:00
Brian Tiger Chow
d61ce41516 fix(bitswap/engine): get priority from wantlist 2015-01-18 15:09:54 -08:00
Brian Tiger Chow
6a580e50d3 doc 2015-01-18 15:09:53 -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
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
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
Jeromy
a09854db97 early out if no entries in wantlist 2015-01-11 08:09:37 +00:00
Juan Batiz-Benet
1ab9588cba p2p/test: bogus key pair for faster tests 2015-01-05 05:48:15 -08:00
Juan Batiz-Benet
10072c149d bitswap: log superfluous messages 2015-01-05 04:55:02 -08:00
Juan Batiz-Benet
aeb2e07198 bitswap: remove DialPeer from interface
Bitswap doesn't usually care about dialing. the underlying
network adapter can make sure of that.
2015-01-05 04:55:02 -08:00
Brian Tiger Chow
05d8c80c39 fix(bitswap/network): return when context is done
@jbenet @whyrusleeping

This bug (missing return) could tie up the client worker and cause
operations to come to a halt.
2015-01-05 00:16:53 -08:00
Juan Batiz-Benet
9c6228d18f bitswap and dht: lots of debugging logs 2015-01-05 00:16:53 -08:00
Juan Batiz-Benet
71ada4696f bitswap net: always close 2015-01-05 00:16:53 -08:00
Juan Batiz-Benet
d357b0ac00 bitswap debug logging 2015-01-05 00:16:53 -08:00
Juan Batiz-Benet
c100390a49 bitswap engine: signal in own func 2015-01-05 00:16:52 -08:00