natpmp: quiet down unconditional logging #33301

issue fanquake openend this issue on September 4, 2025
  1. fanquake commented at 9:10 am on September 4, 2025: member

    Mentioned by @mzumsande here: #31663 (comment)

    I see unconditional log messages [net:warning] pcp: Could not receive response: Connection refused (111) every 5 minutes (in an environment where PCP is expected to not work), and it’s a bit spammy. How about a exponential backoff, similar to how it’s done in torcontrol.cpp?

    cc @darosior @instagibbs

  2. fanquake added this to the milestone 30.0 on Sep 4, 2025
  3. mzumsande commented at 6:08 pm on September 4, 2025: contributor

    How about a exponential backoff, similar to how it’s done in torcontrol.cpp?

    That was just a random association, I don’t know enough about PCP specifics to judge if it makes much sense. Other questions would be:

    • Does this situation deserve an unconditional warning at all instead of just logging to net - how actionable is the warning? (it seems to occur for multiple people)
    • Is it worth trying every 5 minutes forever instead of giving up after a number of tries? Maybe just log unconditionally once but still try ever 5 minutes?
  4. fanquake commented at 6:10 pm on September 4, 2025: member
  5. darosior commented at 6:22 pm on September 4, 2025: member
    cc @laanwj
  6. laanwj commented at 7:13 pm on September 4, 2025: member

    Is it worth trying every 5 minutes forever instead of giving up after a number of tries? Maybe just log unconditionally once but still try ever 5 minutes?

    Yes, imo it is. And i don’t think exponential backoff would be good here, either. If the user switches to a network with a PCP-supporting router, we want to use that as soon as possible.

    But moving the noisy failure messages to a category makes sense, imo. If someone wants to debug PCP issues they can enable that category.

  7. laanwj referenced this in commit 4f1a4cbccd on Sep 4, 2025
  8. achow101 closed this on Sep 4, 2025

  9. achow101 referenced this in commit 647cdb4f7e on Sep 4, 2025
  10. krud491 commented at 11:43 pm on September 4, 2025: none
    Use markdown for format

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-09-07 09:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me