Commit Graph

21 Commits

Author SHA1 Message Date
ljedrz
a070ca13d0 fix: make the retrying loop in wantlist_cancellation less busy
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-13 18:00:28 +02:00
ljedrz
c930f651fd test: make async tests use only 1 thread
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-13 16:16:20 +02:00
ljedrz
398aa58877 chore: import reordering with cargo fmt
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-13 16:15:45 +02:00
ljedrz
8be75f7a4a feat: change the async executor to tokio
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-13 16:15:14 +02:00
Joonas Koivunen
c95a9bb862 fix: first drop mutex guard, then assert
the assert while holding the guard poisons the mutex and that causes
drop to panic because of the poisoned mutex, by design; see last
commit. by shortening the scope of the mutex guard we should once again
see more clear build failures :)
2020-08-11 13:51:17 +03:00
Joonas Koivunen
9e695e02cb fix: go back to std::sync::Mutex
Turns out #174 was wrong, as the alternative required sprinkling
block_on which made the whole thing worse. we shouldn't risk a deadlock
with the mutex as we are not (can not) holding it across awaits.

unwrap as we are not expecting subscriptions to panic and poison the
mutex.
2020-08-11 13:03:45 +03:00
ljedrz
f5f6790062 chore: depend on cid instead of libipld where only Cid is used
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-06 11:38:27 +02:00
ljedrz
e0d43ed861 feat: more logs
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-30 15:21:03 +02:00
ljedrz
0140c673b8 feat: attach tracing to nodes
Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-30 14:53:38 +02:00
Joonas Koivunen
7b71137eb8 fix: cleanup also the Pending related subs
earlier commit already included cleanup for the Ready and Cancelled
cases and this will do the same for Pending cases. the end result
doesn't change but as is apparent from the test changes: a single
Some(0) becomes None. however this does remove leaking and potential
bugs when a previously completed subscription would be reused.
2020-07-30 11:10:20 +03:00
ljedrz
ff1765ba10 fix: remove unused params in Node::new and IpfsOptions::inmemory_with_generated_keys
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-22 15:35:25 +02:00
ljedrz
856c41f8dc fix: async-ify and simplify bounded_retry
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-21 11:26:42 +02:00
ljedrz
4b60684f73 refactor: use the Node object in the wantlist cancellation test
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-20 15:56:09 +02:00
ljedrz
9e013101a3 fix: increase some wantlist test timeouts
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-20 15:30:09 +02:00
ljedrz
6a646d73d6 feat: test wantlist/subscriptions coop
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-20 15:30:09 +02:00
ljedrz
1b1ab37fd2 feat: extend the wantlist cancellation test
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-15 16:02:33 +02:00
ljedrz
415a7e9cf8 fix: make the wantlist cancellation test work on separate tasks
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-14 13:58:30 +02:00
ljedrz
3d564526e8 fix: make wantlist conformance tests pass
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-14 11:43:11 +02:00
ljedrz
8ef92259e7 feat: improve the wantlist cancellation test
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-13 15:43:42 +02:00
ljedrz
7cbf65a373 fix: use Cid v0 for subscriptions
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-13 15:43:42 +02:00
ljedrz
a9f763cf97 feat: cancel Blocks from the wantlist when all their Subscriptions die
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-13 15:43:42 +02:00