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

*: Ensure GossipEngine is being polled #836

Closed
wants to merge 3 commits into from

Conversation

mxinden
Copy link
Contributor

@mxinden mxinden commented Feb 11, 2020

With paritytech/substrate#4767 a GossipEngine
does not spawn its own tasks, but relies on its owner to poll it. This
patch removes the unneeded executor argument and spawns the gossip
engine as an orphaned task onto the executor instead.

ba3b548 is the core of the pull request and should be reviewed.

c1fb81b is temporary and makes Polkadot use a patched version of Substrate's polkadot-master which includes paritytech/substrate#4767.

🛑 Please don't merge yet, given that c1fb81b is not yet removed.

With paritytech/substrate#4767 a `GossipEngine`
does not spawn its own tasks, but relies on its owner to poll it. This
patch removes the unneeded executor argument and spawns the gossip
engine as an orphaned task onto the executor instead.
@mxinden mxinden added the A0-please_review Pull request needs code review. label Feb 11, 2020
@mxinden mxinden requested a review from rphmeier February 11, 2020 11:17
@parity-cla-bot
Copy link

It looks like @mxinden signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

@mxinden mxinden marked this pull request as ready for review February 12, 2020 14:32
@mxinden
Copy link
Contributor Author

mxinden commented Feb 13, 2020

Friendly ping @rphmeier @andresilva.

POLKADOT_ENGINE_ID,
gossip_side,
);

// Ideally this would not be spawned as an orphaned task, but polled by
// `RegisteredMessageValidator` which in turn would be polled by a `ValidationNetwork`.
Copy link
Contributor

Choose a reason for hiding this comment

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

note that when we remove the legacy code we will use protocol.rs which could run this in a future.

// `RegisteredMessageValidator` which in turn would be polled by a `ValidationNetwork`.
let spawn_res = executor.spawn_obj(futures::task::FutureObj::from(Box::new(gossip_engine.clone())));

// Note: we consider the chances of an error to spawn a background task almost null.
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, but should we panic instead? This code will only be run on node startup, maybe it makes sense to just fail right away?

Copy link
Contributor

Choose a reason for hiding this comment

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

A graceful exit would be hard to include, but maybe a warning would be good.

@rphmeier rphmeier added A1-onice and removed A0-please_review Pull request needs code review. labels Feb 14, 2020
@bkchr
Copy link
Member

bkchr commented Feb 15, 2020

Superseded by: #834

@bkchr bkchr closed this Feb 15, 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.

6 participants