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

feat(ping): making the ignoring of the first error configurable #5005

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stormshield-frb
Copy link
Contributor

@stormshield-frb stormshield-frb commented Dec 11, 2023

Description

Fix #5004

Notes & open questions

Instead of using a silent_first_error: bool, we could also use a ignored_errors_nb: usize. However, since there was previously a self.config.max_failures and it was removed, I did not re-do it. Of course, if it is preferred I can do it.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@stormshield-frb stormshield-frb force-pushed the feat/add-configurable-silent-ping-error branch from c1e036c to 092ec64 Compare December 11, 2023 13:48
Copy link
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

I am overall okay with this but I think we should name this something like a "compatibility"-mode with implementations that use one stream per ping.

Maybe something like:

pub fn with_allow_new_stream_per_ping() { }

In the rust docs, we can then explain that this is for compatibility with other implementations.

I don't actually know what the recommended way is. In general, we prefer short-lived streams. I think we could actually remove a lot of this code if we'd move away from a long-lived ping stream. Old rust-libp2p clients are already compatible with this.

@mxinden What do you think? Do you have any historical knowledge on this?

@mxinden
Copy link
Member

mxinden commented Dec 28, 2023

@mxinden What do you think? Do you have any historical knowledge on this?

No historical knowledge beyond what is posted above. I am fine with either direction. Preference for no additional config flag if possible.

@thomaseizinger
Copy link
Contributor

@mxinden What do you think? Do you have any historical knowledge on this?

No historical knowledge beyond what is posted above. I am fine with either direction. Preference for no additional config flag if possible.

Okay thank you! Re-reading the spec, I think it is safe to move away from a long-lived stream and instead only ever send a single ping and close the stream afterwards. @stormshield-frb Would you mind re-writing this PR to do that? I think that should also solve #5004.

@stormshield-frb
Copy link
Contributor Author

About moving away from long-lived stream, will it not be a costly to open and close streams with TCP or Yamux for example ? I understand that it is almost free with QUIC but unfortunately it is not the case with every transports. What do you think about it ?

@thomaseizinger
Copy link
Contributor

About moving away from long-lived stream, will it not be a costly to open and close streams with TCP or Yamux for example ? I understand that it is almost free with QUIC but unfortunately it is not the case with every transports. What do you think about it ?

Yamux streams are similarly cheap to QUIC streams! :)

Copy link

mergify bot commented Apr 15, 2024

This pull request has merge conflicts. Could you please resolve them @stormshield-frb? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(ping): make the ignoring of the first error configurable
3 participants