Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to stable futures (#2). #100

Merged
merged 7 commits into from
Jan 15, 2020
Merged

Conversation

romanb
Copy link
Contributor

@romanb romanb commented Nov 28, 2019

This is a new version of #81 which was later reverted in #89. Compared to that PR, the following has changed:

  • Rebased on top of the latest changes in master.
  • Updated to futures-0.3.1 and futures_timer-2.0.2
  • The voter tests have been changed to use a LocalPool instead of a ThreadPool. The introduction of the ThreadPool in the tests in Update to stables futures #81 caused at least one test to be subject to a race condition (import_commit_for_any_round). While that can of course be addressed in the test, using a LocalPool is much closer to the current tokio behaviour in the tests, where all futures spawned within the lazy block are only polled once the lazy block has completed, since these spawns happen in the context of a current-thread executor (although this was not even guaranteed by tokio). In any case, it makes the tests less fragile to reordering of statements, hence I went with the LocalPool to simplify the tests.

To not introduce too many changes (and because I want to rebase #93 in turn on top of this PR), I did not try to make use of async/await anywhere.

@romanb
Copy link
Contributor Author

romanb commented Nov 28, 2019

A note on the test failure in this run of broadcast_commit_only_if_newer: This is actually not new. I reproduced the same sporadic error on master earlier. To witness:

thread 'voter::tests::broadcast_commit_only_if_newer' panicked at 'assertion failed: res.is_err()', src/voter/mod.rs:1118:6
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
test voter::tests::broadcast_commit_only_if_newer ... FAILED

I can either take a closer look at that in the context of this PR or create a ticket for it, whatever is preferable.

@rphmeier
Copy link
Contributor

rphmeier commented Dec 2, 2019

A separate ticket for the test failure sounds good, since it's not caused by this PR.

}
}
}

impl<H, N, E: Environment<H, N>> Unpin for BackgroundRound<H, N, E> where
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised this isn't an auto impl

@rphmeier
Copy link
Contributor

rphmeier commented Dec 2, 2019

To avoid any divergence between GRANDPA master and whatever Substrate is pointing to, I'd prefer to have a PR to Substrate ready to go before merging this. Pierre also started on one of those in paritytech/substrate#3909. When that or a similar PR is at least ready for review with CI passing, we can merge this

@expenses
Copy link
Contributor

I might have a go at updating Pierre's PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants