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

identify: Replace FuturesUnordered with FuturesStream #302

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

lexnv
Copy link
Collaborator

@lexnv lexnv commented Dec 11, 2024

This PR replaces the identify FuturesUnordered with FuturesStream. This effectively fixes delays in processing outbound events.

  • ensure that identify warns if the transport service is closed (produces no events).
  • identify no longer exits on pending outbound events

Related to:

cc @paritytech/networking

@lexnv lexnv added the bug Something isn't working label Dec 11, 2024
@lexnv lexnv self-assigned this Dec 11, 2024
@lexnv lexnv added enhancement New feature or request and removed bug Something isn't working labels Dec 11, 2024
@@ -356,7 +357,10 @@ impl Identify {
loop {
tokio::select! {
event = self.service.next() => match event {
None => return,
None => {
tracing::warn!(target: LOG_TARGET, "transport service stream ended, terminating identify event loop");
Copy link

@iulianbarbu iulianbarbu Dec 11, 2024

Choose a reason for hiding this comment

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

Is this a warn because a terminated identify loop is not expected in normal operation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, we don't expect any of these components to exit under normal circumstances. If they exit however, this should give us enough information about what happened to isolate the issue 🙏

src/protocol/libp2p/identify.rs Outdated Show resolved Hide resolved
@lexnv lexnv merged commit e9a009f into master Dec 11, 2024
2 checks passed
@lexnv lexnv deleted the lexnv/identify-fix branch December 11, 2024 17:07
lexnv added a commit that referenced this pull request Dec 12, 2024
## [0.8.4] - 2024-12-12

This release aims to make the MDNS component more robust by fixing a bug
that caused the MDNS service to fail to register opened substreams.
Additionally, the release includes several improvements to the
`identify` protocol, replacing `FuturesUnordered` with `FuturesStream`
for better performance.

### Fixed

- mdns/fix: Failed to register opened substream
([#301](#301))

### Changed

- identify: Replace FuturesUnordered with FuturesStream
([#302](#302))
- chore: Update hickory-resolver to version 0.24.2
([#304](#304))
- ci: Ensure cargo-machete is working with rust version from CI
([#303](#303))


cc @paritytech/networking

---------

Signed-off-by: Alexandru Vasile <[email protected]>
github-merge-queue bot pushed a commit to paritytech/polkadot-sdk that referenced this pull request Dec 12, 2024
## [0.8.4] - 2024-12-12

This release aims to make the MDNS component more robust by fixing a bug
that caused the MDNS service to fail to register opened substreams.
Additionally, the release includes several improvements to the
`identify` protocol, replacing `FuturesUnordered` with `FuturesStream`
for better performance.

### Fixed

- mdns/fix: Failed to register opened substream
([#301](paritytech/litep2p#301))

### Changed

- identify: Replace FuturesUnordered with FuturesStream
([#302](paritytech/litep2p#302))
- chore: Update hickory-resolver to version 0.24.2
([#304](paritytech/litep2p#304))
- ci: Ensure cargo-machete is working with rust version from CI
([#303](paritytech/litep2p#303))


cc @paritytech/networking

---------

Signed-off-by: Alexandru Vasile <[email protected]>
lexnv added a commit to paritytech/polkadot-sdk that referenced this pull request Dec 12, 2024
## [0.8.4] - 2024-12-12

This release aims to make the MDNS component more robust by fixing a bug
that caused the MDNS service to fail to register opened substreams.
Additionally, the release includes several improvements to the
`identify` protocol, replacing `FuturesUnordered` with `FuturesStream`
for better performance.

### Fixed

- mdns/fix: Failed to register opened substream
([#301](paritytech/litep2p#301))

### Changed

- identify: Replace FuturesUnordered with FuturesStream
([#302](paritytech/litep2p#302))
- chore: Update hickory-resolver to version 0.24.2
([#304](paritytech/litep2p#304))
- ci: Ensure cargo-machete is working with rust version from CI
([#303](paritytech/litep2p#303))


cc @paritytech/networking

---------

Signed-off-by: Alexandru Vasile <[email protected]>
dudo50 pushed a commit to paraspell-research/polkadot-sdk that referenced this pull request Jan 4, 2025
## [0.8.4] - 2024-12-12

This release aims to make the MDNS component more robust by fixing a bug
that caused the MDNS service to fail to register opened substreams.
Additionally, the release includes several improvements to the
`identify` protocol, replacing `FuturesUnordered` with `FuturesStream`
for better performance.

### Fixed

- mdns/fix: Failed to register opened substream
([paritytech#301](paritytech/litep2p#301))

### Changed

- identify: Replace FuturesUnordered with FuturesStream
([paritytech#302](paritytech/litep2p#302))
- chore: Update hickory-resolver to version 0.24.2
([paritytech#304](paritytech/litep2p#304))
- ci: Ensure cargo-machete is working with rust version from CI
([paritytech#303](paritytech/litep2p#303))


cc @paritytech/networking

---------

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
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants