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

Wait peers to connect before doing anything else #7375

Merged
merged 2 commits into from
Jun 16, 2023

Conversation

altonen
Copy link
Contributor

@altonen altonen commented Jun 15, 2023

There is a race condition in NetworkBridgeRx between registering incoming peers and handling overseer signals. While the peer connection was sent to NetworkBridgeRx first, sometimes the peer would be added to validation/collation_peers with enough delay that the bridge handled an overseer signal that was meant do send notifications to the registered peer and as the peer was not present in the bridge, the notification was never sent and the test would hang.

When peers are registered to NetworkBridgeRx using connect_peer(), wait until they show up in shared.validation/collation_peers before doing anything else.

Fixes #7367

There is a race condition in `NetworkBridgeRx` between registering
incoming peers and handling overseer signals. While the peer connection
was sent to `NetworkBridgeRx` first, sometimes the peer would be added to
`validation/collation_peers` with enough delay that the bridge handled
an overseer signal that was meant do send notifications to the registered
peer and as the peer was not present in the bridge, the notification was
never sent and the test would hang.

When peers are registered to `NetworkBridgeRx` using `connect_peer()`,
wait until they show up in `shared.validation/collation_peers` before
doing anything else.
@altonen altonen 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. T4-parachains_engineering This PR/Issue is related to Parachains performance, stability, maintenance. labels Jun 15, 2023
@altonen
Copy link
Contributor Author

altonen commented Jun 16, 2023

bot rebase

@paritytech-processbot
Copy link

Rebased

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. T4-parachains_engineering This PR/Issue is related to Parachains performance, stability, maintenance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NetworkBridgeRx tests are flaky
3 participants