Skip to content

fix(upnp): add exponential backoff for failed port mappings - #6128

Merged
mergify[bot] merged 1 commit into
libp2p:masterfrom
RolandSherwin:upnp_limit_failed_retries
Sep 1, 2025
Merged

fix(upnp): add exponential backoff for failed port mappings#6128
mergify[bot] merged 1 commit into
libp2p:masterfrom
RolandSherwin:upnp_limit_failed_retries

Conversation

@RolandSherwin

@RolandSherwin RolandSherwin commented Aug 11, 2025

Copy link
Copy Markdown
Contributor

Description

This commit aims to fix an infinite retry loop of failed mappings. We now have an exponential backoff and would retry any failed mappings upto 5 times before giving up.

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

@jxs jxs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi, and thanks for this!
Overall looks good to me, left a question

Comment thread protocols/upnp/src/behaviour.rs
@RolandSherwin
RolandSherwin force-pushed the upnp_limit_failed_retries branch from fc36065 to 2608566 Compare August 26, 2025 01:53
Comment thread protocols/upnp/src/behaviour.rs Outdated
@RolandSherwin
RolandSherwin force-pushed the upnp_limit_failed_retries branch from 2608566 to ecc1153 Compare August 31, 2025 11:12

@ackintosh ackintosh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me!

@jxs jxs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks! And Thanks Akihito for the help with the review

@jxs jxs added the send-it label Sep 1, 2025
@mergify
mergify Bot merged commit aefbfbd into libp2p:master Sep 1, 2025
70 checks passed
mergify Bot pushed a commit that referenced this pull request Sep 11, 2025
This PR aims to expose the local listen address for a corresponding successful port-map to the end user. It would be great to know which local adapter was successfully mapped, when the user has multiple local adapters that they're listening on.

Note: #6127 and #6128 were part of the original PR.

Pull-Request: #6121.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants