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

Manually pin Sleep futures #2914

Merged
merged 2 commits into from
Oct 22, 2021
Merged

Conversation

jvff
Copy link
Contributor

@jvff jvff commented Oct 20, 2021

Motivation

This is part of the update to use Tokio version 1 (#2200), but can be merged separately.

Newer versions of Tokio have a Sleep type that doesn't implement Unpin, so it must be pinned before it can be polled.

Solution

Two instances of Sleep were updated to use Box<Pin<Sleep>> so that they can be polled.

Review

Anyone from the team can review this.

Reviewer Checklist

  • Code implements Specs and Designs
  • Tests for Expected Behaviour
  • Tests for Errors

Follow Up Work

@jvff jvff requested a review from a team October 20, 2021 18:33
@zfnd-bot zfnd-bot bot assigned jvff Oct 20, 2021
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

This PR conflicts with PR #2912, due to changes in the Connection struct.
#2912 should merge first.

Hopefully the recent CI fixes will make the tests pass on this PR.

jvff added 2 commits October 22, 2021 11:57
The `Sleep` type doesn't implement `Unpin` in newer versions of Tokio.
In newer Tokio versions the `Sleep` type doesn't implement `Unpin`, so
it needs to be manually pinned.
@jvff jvff force-pushed the pin-sleep-futures branch from 2aacd75 to a21ce1d Compare October 22, 2021 12:03
@jvff jvff requested a review from teor2345 October 22, 2021 12:03
Copy link
Collaborator

@conradoplg conradoplg left a comment

Choose a reason for hiding this comment

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

Looks good!

@conradoplg conradoplg merged commit 2a1d428 into ZcashFoundation:main Oct 22, 2021
@mpguerra mpguerra mentioned this pull request Oct 29, 2021
10 tasks
@jvff jvff deleted the pin-sleep-futures branch November 23, 2021 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants