Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Use tokio instead of async_std #307

Merged
merged 6 commits into from
Aug 13, 2020
Merged

Use tokio instead of async_std #307

merged 6 commits into from
Aug 13, 2020

Conversation

ljedrz
Copy link
Member

@ljedrz ljedrz commented Aug 13, 2020

We already use it in ipfs-http, our dependencies either already use it or are compatible with it and it has some nice features that we'd like to use.

Note: the async tests now specify max_threads = 1 in order to make sure the multi-threaded executor is not being lenient about any hidden bugs.

fixes #275

Signed-off-by: ljedrz <ljedrz@gmail.com>
Signed-off-by: ljedrz <ljedrz@gmail.com>
Signed-off-by: ljedrz <ljedrz@gmail.com>
Signed-off-by: ljedrz <ljedrz@gmail.com>
Signed-off-by: ljedrz <ljedrz@gmail.com>
@ljedrz ljedrz requested a review from koivunej August 13, 2020 14:21
@@ -24,14 +23,15 @@ domain = { default-features = false, version = "0.5" }
domain-resolv = { default-features = false, version = "0.5" }
futures = { default-features = false, features = ["compat", "io-compat"], version = "0.3.5" }
ipfs-unixfs = { path = "unixfs" }
libp2p = { default-features = false, features = ["floodsub", "identify", "kad", "tcp-async-std", "mdns", "mplex", "noise", "ping", "yamux"], version = "0.23" }
libp2p = { default-features = false, features = ["floodsub", "identify", "kad", "tcp-tokio", "mdns", "mplex", "noise", "ping", "yamux"], version = "0.23" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: soon tokio-mdns as well, mdns might still use async-std by default.

Copy link
Member Author

@ljedrz ljedrz Aug 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I was looking at the main features in search for other tokio ones and found none - mdns does use async-std right now; probably gonna change soon, like you're saying.

@ljedrz
Copy link
Member Author

ljedrz commented Aug 13, 2020

it seems that the resolve tests don't like Windows; since this is a big PR and I wouldn't want to keep other PRs waiting I'll #[ignore] them again for now.

Signed-off-by: ljedrz <ljedrz@gmail.com>
@koivunej
Copy link
Collaborator

The failure for future reference: https://github.com/rs-ipfs/rust-ipfs/runs/980815860#step:16:64

it seems that the resolve tests don't like Windows

Did you understand from somewhere else that this could be wider issue? Could be that windows is behind a restricted dns for example or just this particular runner was without global dns.

Note: the async tests now specify max_threads = 1 in order to make sure the multi-threaded executor is not being lenient about any hidden bugs.

From probably the first bad tests/ case I've hoped we could go back to tokio for single threaded test cases. Turns out a lot of the test cases have been just flaky/broken but this should stop us from writing any futures which are always ready for example, though it's been a while since I last wrote such. In multi threaded runtime those will be fine, but on single threaded runtime hopefully the runtime should grind to a halt but at minimum it should be noticeable.

Copy link
Collaborator

@koivunej koivunej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice to have even smaller Cargo.lock

@koivunej
Copy link
Collaborator

I think windows is about to hang again.

bors r+

@bors
Copy link
Contributor

bors bot commented Aug 13, 2020

Build succeeded:

@bors bors bot merged commit 143c3da into rs-ipfs:master Aug 13, 2020
@ljedrz ljedrz deleted the tokio branch August 13, 2020 16:37
@koivunej koivunej mentioned this pull request Aug 14, 2020
6 tasks
@koivunej koivunej mentioned this pull request Sep 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ipfs-http crate has two different runtimes
2 participants