Commit Graph

654 Commits

Author SHA1 Message Date
Jakub Sztandera
b91dfbfec4 exchange: reintroduce info on wantlist update to no connected peer
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2018-03-12 23:23:27 +01:00
Steven Allen
f8a7683f25 don't warn when trying to send wantlist to disconnected peers
fixes #4439

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-03-12 23:22:19 +01:00
Steven Allen
e3d9e05ec2 fix race in TestWantlistClearsOnCancel
fixes #4726

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-02-21 12:35:56 -08:00
Whyrusleeping
53af4530ed
Merge pull request #4711 from ipfs/extract/pq
Extract thirdparty/pq to go-ipfs-pq
2018-02-15 15:33:15 -08:00
Hector Sanjuan
9b6a63e768 Extract thirdparty/pq to go-ipfs-pq
This moves the `thirdparty/pq` package to https://github.com/ipfs/go-ipfs-pq .

History has been retained. The new package has been gx'ed and published.
Imports have been updated accordingly.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-15 23:08:08 +01:00
Hector Sanjuan
6950d0688e Point briantigerchow/pubsub GoDep'ed module to the gx'ed version
This removes briantigerchow/pubsub from Godeps and uses our
gx'ed version instead.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-15 23:05:49 +01:00
Hector Sanjuan
758e00bc4c Extract blocks/blockstore package to go-ipfs-blockstore
This extracts the blocks/blockstore package and renames the
blocks/blockstore/util package to /blocks/blockstoreutil
(because util depends on Pin and I don't plan to extract
Pin and its depedencies).

The history of blocks/blockstore has been preserved. It has
been gx'ed and imported. Imports have been rewritten accordingly
and re-ordered.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-15 18:03:41 +01:00
Hector Sanjuan
54d87b4ce0 Extract: routing package to github.com/ipfs/go-ipfs-routing
This extracts the routing package to its own repository
(https://github.com/ipfs/go-ipfs-routing). History has
been preserved. The new module has been gx'ed and published.

Imports have been rewritten and re-ordered accordingly.

An internal dependency to go-ipfs/repo has been removed
by substituting it with the go-datastore.Batching interface.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-14 18:33:52 +01:00
Whyrusleeping
4aaf24f56d
Merge pull request #4658 from ipfs/fix/session-cleanup
shutdown notifications engine when closing a bitswap session
2018-02-13 13:11:57 -08:00
Hector Sanjuan
982af8af69 More consistency in imports
Per @magik6k comments.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-13 11:29:32 +01:00
Jeromy
0dd0f25271 bitswap virtual test net code should send messages in order
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2018-02-12 23:40:15 -08:00
Steven Allen
d4d30f4e8a bitswap: actually *update* wantlist entries in outbound wantlist messages
Before, we weren't using a pointer so we were throwing away the update.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-02-12 21:02:19 -08:00
Hector Sanjuan
c9080f99e8 Import re-ordering
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-12 22:51:42 +01:00
Hector Sanjuan
fd04905adb Extract: flags and thirdparty/delay submodules
They have been moved to their own repositories:

* github.com/ipfs/go-ipfs-delay
* github.com/ipfs/go-ipfs-flags

History has been preserved. They have been published
with gx'ed. Imports have been updated and re-ordered
accordingly.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-12 22:51:03 +01:00
Hector Sanjuan
a4115e9e14 Extract go-detect-race from Godeps
I have forked it, put it under ipfs namespace, published to gx

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-12 12:35:34 +01:00
Steven Allen
1a37c0a870 avoid publishing if notification system has been shut down
(will deadlock)

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-02-11 12:51:50 -08:00
Steven Allen
2baa3312d1 bitswap: test canceling subscription context after shutting down
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-02-09 17:33:57 -08:00
Steven Allen
53958266d6 bitswap: finish unsubscribing from the pubsub instance before shutting it down
Otherwise, we'll deadlock and leak a goroutine. This fix is kind of crappy but
modifying the pubsub library would have been worse (and, really, it *is*
reasonable to say "don't use the pubsub instance after shutting it down").

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-02-09 12:19:21 -08:00
Steven Allen
2b99858dda remove excessive time.Now() calls from bitswap sessions
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-02-09 12:18:58 -08:00
Jeromy
64c19cc904 WIP: fix wantlist clearing by closing down session
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2018-02-09 12:18:58 -08:00
Jeromy
82e1ff585f shutdown notifications engine when closing a bitswap session
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2018-02-09 12:18:58 -08:00
Steven Allen
b2cbfd299c gx: update go-log
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-01-31 21:54:22 -08:00
Steven Allen
5acbecc26b update go-lib2p-loggables
fixes a UUID bug I introduced (UUIDs were always an error value)

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-01-27 18:05:30 -08:00
Steven Allen
fe8846fcd7 gx: mass update
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-01-24 15:58:44 -08:00
Steven Allen
914e653828 only construct bitswap event loggable if necessary
Base58 encoding cids/peerIDs isn't exactly fast.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-29 13:00:24 -08:00
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