Commit Graph

629 Commits

Author SHA1 Message Date
Steven Allen
a5e9d0a23a make bitswap tests pass again with the race detector enabled
fixes #2444

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-15 15:46:33 -08:00
Steven Allen
a77e0e4713 fix races in testnet
ConnectTo can be called concurrently from within bitswap.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-15 13:44:28 -08:00
Steven Allen
4d8c4439c2 improve basic bitswap test
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-15 13:25:12 -08:00
Steven Allen
dfe7ef4fcf gx: update go-multihash
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-14 13:09:51 -08:00
Whyrusleeping
7fd7ab6929
Merge pull request #4472 from ipfs/fix/4470
Demote bitswap error to an info
2017-12-09 18:57:10 +01:00
Steven Allen
72582c9a37 Demote bitswap error to an info
Not being able to dial a peer we used to be connected to is interesting but
definitely not an error.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-08 14:04:34 -08:00
Steven Allen
93151d4c33 bitswap: fewer allocations in bitswap sessions
Also, don't call time.Now in a loop.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-07 11:43:58 -08:00
Steven Allen
15c734188f bitswap: better wantmanager allocation patterns
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-07 11:43:58 -08:00
Steven Allen
0c91b183eb bitswap: preallocate cid string array
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-07 11:43:58 -08:00
Steven Allen
a589470329 bitswap: better allocation patters in message
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-07 11:43:58 -08:00
Steven Allen
36cf839a55 bitswap: remove useless code
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-07 11:43:58 -08:00
Steven Allen
764cbe1c5b bitswap: better wantlist allocation patterns
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-07 11:43:58 -08:00
Steven Allen
cb2ed89252 bitswap: defer unlock when possible
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-07 11:43:58 -08:00
Steven Allen
0f8155b668 bitswap: preallocate peers array on bitswap stat
Avoids lots of reallocations under a lock.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-07 11:43:58 -08:00
Łukasz Magiera
6401a9191e gx: Update go-datastore to 1.4.0
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-12-02 14:55:26 -08:00
Whyrusleeping
33c82070f2
Merge pull request #4407 from ipfs/fix/4394
fix deadlock in bitswap sessions
2017-11-21 15:21:25 -08:00
Steven Allen
a94755dbc5 fix deadlock in bitswap sessions
This deadlock would happen when calling SessionsForBlock (holding
bitswap.sessLk) while the session's main loop was trying to deregister the
session (taking bitswap.sessLk).

I've also defensively added selects on contexts for two other channel writes
just in case.

fixes #4394

...well, it fixes *a* deadlock showing up in that issue, there may be more.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-11-20 22:28:32 -08:00
Steven Allen
76e1da02a8 gx: massive update
Note: This commit is technically broken. However, I need to make a bunch of
cmds changes to make this work and I'd rather not bundle both changes into a
single commit.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-11-20 22:20:27 -08:00
keks
0d9d21875c compatible to js-ipfs-api
License: MIT
Signed-off-by: keks <keks@cryptoscope.co>
2017-11-17 15:22:42 +01:00
Jan Winkelmann
f287524949 cmd: use go-ipfs-cmds
License: MIT
Signed-off-by: keks <keks@cryptoscope.co>
2017-11-17 15:22:41 +01:00
Jeromy
332891f7b2 Buffer response channel to prevent deadlock
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-11-12 19:22:42 -08:00
Steven Allen
2f9e9ec571 gx update go-peerstream, go-libp2p-floodsub
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-10-19 08:20:35 -07:00
Jeromy Johnson
5c9125e8b5 Merge pull request #4315 from ipfs/feat/sessions-tagging
tag peers associated with a bitswap session
2017-10-18 16:01:03 +01:00
Jeromy Johnson
329eb1cd1d Merge pull request #4316 from ipfs/fix/bitswap-active-peers
filter out "" from active peers in bitswap sessions
2017-10-18 12:17:52 +01:00
Steven Allen
d727a75e6d NewStream now creates a connection if necessary
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-10-17 15:58:27 -07:00
Steven Allen
37296d3958 filter out "" from active peers in bitswap sessions
We use "" to indicate that the block came from the local node. There's no reason
to record "" as an active peer (doesn't really *hurt* but still...).

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-10-17 15:37:46 -07:00
Jeromy
3eafbea262 tag peers associated with a bitswap session
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-10-17 12:03:48 -07:00
Jeromy
94ec788555 update deps for new connmgr code
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-10-14 05:38:52 -07:00
vyzo
4f1edf2570 update go-testutil to 1.1.12
License: MIT
Signed-off-by: vyzo <vyzo@hackzen.org>
2017-10-05 17:11:39 +03:00
Steven Allen
3f6df3a5f4 update yamux
We need to cancel out all readers/writers on stream reset.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-09-15 18:56:44 -07:00
Steven Allen
adfbecf3f7 use stream.Reset where appropriate
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-09-14 16:10:38 -07:00
Steven Allen
8deaaa8d8c gx: update go-stream-muxer
Introduces a new Reset method on streams that kills both sides of the
connection. Close now officially just closes the write side (what it did all
along...)

* Also pull through shiny new go-multiplexer fixes.
* Also pull in go-reuseport update.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-09-14 12:06:44 -07:00
Jeromy
0eba4f3138 gx: update go-ws-transport
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-09-05 16:18:19 -07:00
Steven Allen
70d6629940 gx: update go-cid, go-multibase, base32
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-09-01 17:46:49 -07:00
Jeromy Johnson
ab9b736388 Merge pull request #4169 from ipfs/fix/4062
add blocks to the blockstore before returning them from blockservice sessions.
2017-08-25 12:07:23 -07:00
Steven Allen
b22d3fbfd9 add blocks to the blockstore before returning them from blockservice sessions.
fixes #4062 (yay!)

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-08-23 21:02:47 -07:00
Łukasz Magiera
e34a5e9c0d gx: update go-reuseport
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-08-23 16:32:32 +02:00
Steven Allen
67c572e750 bitswap_test: make racy test less racy
fixes #4108

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-08-16 17:23:05 -07:00
Steven Allen
19c3bd82a3 extract update go-testutil
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-08-16 17:23:01 -07:00
Steven Allen
38a9be5a0a gx: update go-libp2p-swarm
fixes #4102 (fixed in go-libp2p-swarm)

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-07-31 14:04:40 -07:00
Steven Allen
4ef73ee25d bitswap: serialize connect/disconnect notifications over one channel.
Otherwise, we could end up receiving a disconnect notification before a connect
notification (and think we have a connection that we don't have).

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-07-27 18:48:19 -07:00
Steven Allen
28be1d4c58 gx: update deps
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-07-27 18:48:16 -07:00
Jeromy
39e9328e47 ensure testnet peers get evenly connected mesh
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-07-15 22:37:50 -07:00
Jeromy
a93b44b226 Only open a message sender when we have messages to send
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-07-15 20:18:17 -07:00
Jeromy
cccc6a94a3 update go-multihash and bubble up changes
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-07-11 19:27:43 -07:00
Jeromy
8be07cabd0 fix closing and removal of sessions
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-07-11 09:31:20 -07:00
Jakub Sztandera
dd7589bdaf
bitswap: add few method comments
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-07-07 20:54:07 +02:00
Jeromy
3be5c913ee fix issue with sessions not receiving locally added blocks
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-07-07 11:40:41 -07:00
Jeromy
124afdbaaa extract bitswap metrics to separate struct for 64bit alignment
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-07-06 12:17:25 -07:00
Jeromy
eab2024e43 address CR
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-07-06 12:06:57 -07:00