Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Upgrade tokio to 1.10 #9575

Merged
11 commits merged into from
Aug 24, 2021
Merged

Upgrade tokio to 1.10 #9575

11 commits merged into from
Aug 24, 2021

Conversation

bkchr
Copy link
Member

@bkchr bkchr commented Aug 17, 2021

polkadot companion: paritytech/polkadot#3695

@bkchr bkchr added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Aug 17, 2021
@bkchr bkchr requested a review from andresilva as a code owner August 17, 2021 16:23
@@ -311,7 +313,7 @@ impl TaskManager {
Box::pin(async move {
join_all(children_shutdowns).await;
completion_future.await;
drop(keep_alive);
keep_alive
Copy link
Member

@niklasad1 niklasad1 Aug 23, 2021

Choose a reason for hiding this comment

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

can you explain this change i.e, is drop not required because it's consumed by the future?

Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

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

LGTM expect that I would like an explanation for the removed drop in clean_shutdown for explicit approval

@bkchr
Copy link
Member Author

bkchr commented Aug 23, 2021

LGTM expect that I would like an explanation for the removed drop in clean_shutdown for explicit approval

Yeah, I'm about to add some comment to the code ;)

client/service/test/src/lib.rs Outdated Show resolved Hide resolved
client/service/test/src/lib.rs Outdated Show resolved Hide resolved

// The keep_alive stuff is holding references to some RPC handles etc. These
// RPC handles spawn their own tokio stuff and that doesn't like to be closed in an
// async context. So, we move the deletion to some other thread.
Copy link
Member

Choose a reason for hiding this comment

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

how did it work previously? or is this a change in behavior from tokio 0.2 to 1.0?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think tokio 1.0 can only detect tokio 1.0. So it did not detected the shutdown being async before. And as both used 0.1 or whatever, tokio itself provided an async function.

This is entirely some hackery stuff in here. When we refactor all of this, there should not be any "keep_alive", because this itself is just a hack...

@bkchr
Copy link
Member Author

bkchr commented Aug 24, 2021

bot merge force

@ghost
Copy link

ghost commented Aug 24, 2021

Trying merge.

@ghost ghost merged commit b7a1a2c into master Aug 24, 2021
@ghost ghost deleted the bkchr-upgrade-to-tokio-1.0 branch August 24, 2021 14:31
Wizdave97 pushed a commit to Wizdave97/substrate that referenced this pull request Aug 25, 2021
* Upgrade tokio to 1.10

* Fix test runner

* Try fix it

* Update Cargo.lock

* Review feedback

* ahhhh

* FML

* FMT

* Fix tests
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants