Skip to content

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

Merged
lexnv merged 12 commits intomasterfrom
lexnv/substream-poll-unexpected
Feb 28, 2025
Merged

notifications/libp2p: Terminate the outbound notification substream on std::io::Errors#7724
lexnv merged 12 commits intomasterfrom
lexnv/substream-poll-unexpected

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
teor2345 pushed a commit to autonomys/polkadot-sdk that referenced this pull request Mar 24, 2025
…n `std::io::Errors` (paritytech#7724) - conflicts resolved using --strategy-option=theirs

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: paritytech#7722

---------

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.

6 participants