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

*: Bump async-std to v1.6.5 #7306

Merged
9 commits merged into from
Oct 20, 2020
Merged

*: Bump async-std to v1.6.5 #7306

9 commits merged into from
Oct 20, 2020

Conversation

mxinden
Copy link
Contributor

@mxinden mxinden commented Oct 12, 2020

Prevent users from using v1.6.4 which faces issues receiving incoming
TCP connections. See async-rs/async-std#888
for details.

//CC @JoshOrndorff

Release note suggestion:

Methods on sc_network::gossip::QueuedSender take &mut self instead of self.

Prevent users from using v1.6.4 which faces issues receiving incoming
TCP connections. See async-rs/async-std#888
for details.
@mxinden mxinden 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. labels Oct 12, 2020
@bkchr
Copy link
Member

bkchr commented Oct 12, 2020

As we had seen last week in polkadot, this makes the web wasm build fail.

`async_std::sync::Condvar::wait_timeout` uses
`gloo_timers::callback::Timeout` when compiled for
`wasm32-unknown-unknown`. This timeout implementation does not fulfill
the requirement of being `Send`.

Instead of using a `Condvar` use a `futures::channel::mpsc` to signal
progress from the `QueuedSender` to the background `Future`.
@mxinden
Copy link
Contributor Author

mxinden commented Oct 12, 2020

As we had seen last week in polkadot, this makes the web wasm build fail.

This would be fixed with 96c9f6b which uses a channel instead of a condvar as suggested here:

client/network/src/gossip: Use channel instead of condvar

`async_std::sync::Condvar::wait_timeout` uses
`gloo_timers::callback::Timeout` when compiled for
`wasm32-unknown-unknown`. This timeout implementation does not fulfill
the requirement of being `Send`.

Instead of using a `Condvar` use a `futures::channel::mpsc` to signal
progress from the `QueuedSender` to the background `Future`.

See rustwasm/gloo#109 for details on Timeout not being Send.

Before I iron out any outstanding TODOs, @tomaka would this be a valid solution for you?

@tomaka tomaka added the A1-needs_burnin Pull request needs to be tested on a live validator node before merge. DevOps is notified via matrix label Oct 13, 2020
Copy link
Contributor Author

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

tomaka added the A1-needsburnin label 43 minutes ago

I don't think the needsburnin label is helpful here. As far as I can tell QueuedSender is never constructed within the Substrate or Polkadot codebase apart from unit tests. Guess it is still worth testin async-std 1.6.5 itself.

@@ -67,6 +67,9 @@ mod tests;
pub struct QueuedSender<M> {
/// Shared between the front and the back task.
shared: Arc<Shared<M>>,
// TODO: Can we get around this Mutex? E.g. by taking `&mut` for `lock_queue` and
// `queue_or_discard`.
notify_background_future: Mutex<Sender<()>>,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tomaka I would like to remove the need for this Mutex, thus requiring QueuedSender::lock_queue and QueuedSender::queue_or_discard to take a &mut self. Is the current &self a design requirement?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good question. I think you can switch to &mut self, and we can always switch back later if needed.

The `queue_size_limit` field is only accessed by `QueuedSender`, thus
there is no need to share it between the background future and the
`QueuedSender`.
To be a bit picky the background task is not a task in the sense of an
asynchonous task, but rather a background future in the sense of
`futures::future::Future`.
@mxinden mxinden added B3-apinoteworthy and removed B0-silent Changes should not be mentioned in any release notes labels Oct 13, 2020
@mxinden
Copy link
Contributor Author

mxinden commented Oct 13, 2020

@tomaka would you mind taking another look?

@mxinden mxinden added A1-needs_burnin Pull request needs to be tested on a live validator node before merge. DevOps is notified via matrix and removed A1-needs_burnin Pull request needs to be tested on a live validator node before merge. DevOps is notified via matrix labels Oct 14, 2020
@mxinden
Copy link
Contributor Author

mxinden commented Oct 15, 2020

This patch has been deployed on two sentry nodes for the last 3 hours. Substrate service tasks, Substrate networking nor the Node Exporter dashboard show any anomalies.

Only thing sticking out is the number of peers the nodes have more than one connection to. This seems to be increasing since the redeployment of the nodes:

image

Update: Stabilized in the last couple of days.

@mxinden
Copy link
Contributor Author

mxinden commented Oct 20, 2020

bot merge

@ghost
Copy link

ghost commented Oct 20, 2020

Trying merge.

@ghost ghost merged commit 1524703 into paritytech:master Oct 20, 2020
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. A1-needs_burnin Pull request needs to be tested on a live validator node before merge. DevOps is notified via matrix C1-low PR touches the given topic and has a low impact on builders.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants