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

Merged
merged 12 commits into from
Feb 28, 2025

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
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]>
@lexnv lexnv enabled auto-merge February 28, 2025 16:27
@lexnv lexnv added this pull request to the merge queue Feb 28, 2025
Merged via the queue into master with commit 1bc6ca6 Feb 28, 2025
230 of 253 checks passed
@lexnv lexnv deleted the lexnv/substream-poll-unexpected branch February 28, 2025 17:39
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