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

notifications/libp2p: Terminate the outbound notification substream on std::io::Errors #7724

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

lexnv
Copy link
Contributor

@lexnv lexnv commented Feb 26, 2025

This PR handles a case where we called the poll_next on an outbound substream notification to check if the stream is closed. It is entirely possible that the poll_next would return an io::error, for example end of file.

This PR ensures that we make the distinction between unexpected incoming data, and error originated from poll_next.

While at it, the bulk of the PR change propagates the PeerID from the network behavior, through the notification handler, to the notification outbound stream for logging purposes.

cc @paritytech/networking

Part of: #7722

@lexnv lexnv added the T0-node This PR/Issue is related to the topic “node”. label Feb 26, 2025
@lexnv lexnv self-assigned this Feb 26, 2025
Comment on lines +489 to +493
warn!(
target: "sub-libp2p",
"Error while reading from `NotificationsOutSubstream` peer={:?} error={error:?}",
this.peer_id
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would make a release image and bake this PR in our stack for a bit. The Unexpected incoming data spuriously reproduced yesterday, I would like to gain a bit more data on this before downgrading the io::error warning into a debug

Copy link
Member

Choose a reason for hiding this comment

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

These are programming errors and not something the operator can fix. These should be debug.

Signed-off-by: Alexandru Vasile <[email protected]>
@lexnv lexnv requested a review from a team February 26, 2025 11:47
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/13543012877
Failed job name: test-linux-stable-no-try-runtime

@lexnv lexnv changed the title notifications: Terminate the outbound notification substream on std::io::Errors notifications/libp2p: Terminate the outbound notification substream on std::io::Errors Feb 26, 2025
Signed-off-by: Alexandru Vasile <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T0-node This PR/Issue is related to the topic “node”.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants