Commit Graph

428 Commits

Author SHA1 Message Date
Jeromy
8f0623255d replace imports with absolute path instead of using symlink
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-10-03 14:30:50 -07:00
Jeromy
0c7421643d allow bitswap stat to output wasted bytes
bitswap stat can now track bytes that are wasted by receiving duplicate
blocks.

ps, gitcop smells

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-25 14:40:46 -07:00
Jeromy
63f72a5155 remove context from HasBlock, use bitswap process instead
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-15 17:53:42 -07:00
Juan Benet
46e888bdfc Merge pull request #1701 from ipfs/feat/extract-logging
extract logging
2015-09-15 13:05:31 -04:00
Jeromy
e5a2896c0e extract logging
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-14 17:35:50 -07:00
Jeromy
c38ca0038d implement unwant command to remove blocks from wantlist
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-09 10:50:56 -07:00
Jeromy
c3280ce885 use new methods from goprocess/context, remove thirdparty/waitable
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-08 21:37:40 -07:00
Juan Batiz-Benet
8b99e60b86 bitswap/workers: fix proc / ctx wiring
This commit changes the order of the proc/ctx wiring, to ensure
that the proc has been setup correctly before exiting.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-09-05 04:37:58 +02:00
rht
30e03b2da6 Replace context.TODO in test files with context.Background
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-08-23 19:55:45 +07:00
rht
a7202fa94c Fix 'ctx, _' to have explicit cancel
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-08-23 19:35:03 +07:00
Juan Batiz-Benet
6e705e1ef0 bitswap/provide: improved rate limiting
this PR greatly speeds up providing and add.

(1) Instead of idling workers, we move to a ratelimiter-based worker.
We put this max at 512, so that means _up to_ 512 goroutines. This
is very small load on the node, as each worker is providing to the
dht, which means mostly waiting. It DOES put a large load on the DHT.
but i want to try this out for a while and see if it's a problem.
We can decide later if it is a problem for the network (nothing
stops anyone from re-compiling, but the defaults of course matter).

(2) We add a buffer size for provideKeys, which means that we block
the add process much less. this is a very cheap buffer, as it only
stores keys (it may be even cheaper with a lock + ring buffer
instead of a channel...). This makes add blazing fast-- it was being
rate limited by providing. Add should not be ratelimited by providing
(much, if any) as the user wants to just store the stuff in the local
node's repo. This buffer is initially set to 4096, which means:

  4096 * keysize (~258 bytes + go overhead) ~ 1-1.5MB

this buffer only last a few sec to mins, and is an ok thing to do
for the sake of very fast adds. (this could be a configurable
paramter, certainly for low-mem footprint use cases). At the moment
this is not much, compared to block sizes.

(3) We make the providing EventBegin() + Done(), so that we can
track how long a provide takes, and we can remove workers as they
finish in bsdash and similar tools.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-08-04 20:07:25 +02:00
Karthik Bala
0e597b3ae6 add transport logic to mocknet
License: MIT
Signed-off-by: Karthik Bala <karthikbala444@gmail.com>
2015-07-15 19:36:15 -07:00
Juan Batiz-Benet
a95ce17bd1 Merge pull request #1478 from ipfs/fix/slow-stop
making the daemon shutdown quicker
2015-07-14 15:55:07 -07:00
Jeromy
191ac62c12 making the daemon shutdown quicker
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-14 14:04:56 -07:00
Jeromy
fdf4423c8b fix race introduced in bitswap
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-14 11:11:16 -07:00
Jeromy
a25352d80e publish block before writing to disk
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-13 11:24:49 -07:00
Jeromy
7ef1a470c7 allow bitswap to attempt to write blocks to disk multiple times
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-13 11:01:01 -07:00
Juan Batiz-Benet
6e9c72ab37 expose internal/pb packages.
we shouldn't use internal packages.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-10 11:08:49 -07:00
Jeromy
ff1bf3058e add in some events to bitswap to emit worker information
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-07 12:14:57 -07:00
rht
18f5fcea28 golint util/, thirdparty/
and exchange/bitswap/testutils.go

License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-06-18 10:03:57 +07:00
rht
4b086eff5a Remove Notice{,f} logging interface
And substitute the lines using Notice{,f} with Info{,f}

License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-06-18 10:03:57 +07:00
Juan Batiz-Benet
848502de1b Merge pull request #1367 from ipfs/wantmanager-cleanup
select with context when sending on channels
2015-06-12 15:14:09 -07:00
Jeromy
b12cc09f64 select with context when sending on channels
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-12 11:32:06 -07:00
Jeromy
e014a66bf5 comments from CR
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-11 16:43:21 -07:00
Jeromy
c5b40b3b02 prevent wantmanager from leaking goroutines (and memory)
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-11 09:38:09 -07:00
Jeromy
ef294431d4 move util.Key into its own package under blocks 2015-06-01 16:10:08 -07:00
Jeromy
2ec4c9ac45 handle error 2015-05-29 18:28:50 -07:00
Jeromy
11de364384 parallelize block processing 2015-05-29 18:28:50 -07:00
Jeromy
ab161cf6b4 clean up organization of receivemessage and fix race 2015-05-29 18:28:50 -07:00
Jeromy
efa442ada2 adjust naming 2015-05-29 18:28:50 -07:00
Jeromy
f574cd4b80 Move findproviders out of main block request path
This PR moves the addition of new blocks to our wantlist (and their
subsequent broadcast to the network) outside of the clientWorker loop.
This allows blocks to more quickly propogate to peers we are already
connected to, where before we had to wait for the previous findProviders
call in clientworker to complete before we could notify our partners of
the next blocks that we want. I then changed the naming of the
clientWorker and related variables to be a bit more appropriate to the
model. Although the clientWorker (now named providerConnector) feels a
bit awkward and should probably be changed.

fix test assumption
2015-05-29 18:28:36 -07:00
rht
3547f7ae33 Replace 'var * bytes.Buffer' with '\1 := new(bytes.Buffer)' 2015-05-26 23:18:04 +07:00
Jeromy
a3356b0417 fix minor data race in bitswap 2015-05-22 13:39:03 -07:00
Jeromy
eff73ccce7 error -> notice, bitswap 2015-05-21 21:24:42 -07:00
Jeromy
ce0d2f46d6 defer tock.Stop() 2015-05-21 03:08:32 -04:00
Jeromy
2f934e8c58 warning -> notice 2015-05-21 03:08:32 -04:00
Jeromy
b71a0aced0 clarify synhronization constructs 2015-05-21 03:08:32 -04:00
Jeromy
c273a3bd4f better bitswap logging 2015-05-21 03:08:32 -04:00
Jeromy
2882c793e2 add a distribution test with the rebroadcast delay disabled 2015-05-21 03:08:32 -04:00
Juan Batiz-Benet
2eac921e1d fixup the bitswap readme 2015-05-21 03:08:32 -04:00
Jeromy
829b88420e explicitly set bitswap message fullness 2015-05-21 03:08:31 -04:00
Jeromy
594c7786c3 turn rebroadcast back on 2015-05-21 03:08:31 -04:00
Jeromy
6ab4bfea95 turn tests down a bit and better context passing 2015-05-21 03:08:31 -04:00
Jeromy
65f815a27b move taskdone inside lock boundaries 2015-05-21 03:08:31 -04:00
Jeromy
32da687774 fix race bugs 2015-05-21 03:08:31 -04:00
Jeromy
6bf33ad62f WIP: super awesome bitswap cleanup fixtime 2015-05-21 03:08:31 -04:00
Jeromy
ef967ceeef contextify peermanager 2015-05-21 03:08:31 -04:00
Jeromy
8443b99c1d update comments and reintroduce test 2015-05-21 03:08:31 -04:00
Jeromy
a159e6825c implement peermanager to control outgoing messages
Also more refactoring of bitswap in general, including some perf
improvements and eventlog removal.

clean up, and buffer channels

move some things around

correctly buffer work messages

more cleanup, and improve test perf

remove unneccessary test

revert changes to bitswap message, they werent necessary
2015-05-21 03:08:30 -04:00
Jeromy
225b58e31a remove inflect package 2015-05-20 15:09:20 -07:00