p2p: 25880 fixups (stalling timeout) #26982

pull mzumsande wants to merge 2 commits into bitcoin:master from mzumsande:202201_fix_stalling_test changing 2 files +4 −4
  1. mzumsande commented at 8:54 PM on January 27, 2023: contributor

    Two small fixups to #25880:

  2. test: fix intermittent errors in p2p_ibd_stalling.py
    Using is_connected instead of num_test_p2p_connections
    ensures that python has taken notice that the p2p was
    disconnected.
    6548ba68e8
  3. DrahtBot commented at 8:54 PM on January 27, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK MarcoFalke
    Stale ACK sipa

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label P2P on Jan 27, 2023
  5. sipa commented at 10:48 PM on January 27, 2023: member

    utACK e99207b908b25bbab70077ebbeca1dca989facb2

  6. in src/net_processing.cpp:5739 in e99207b908 outdated
    5735 | @@ -5736,7 +5736,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
    5736 |              // bandwidth is insufficient.
    5737 |              const auto new_timeout = std::min(2 * stalling_timeout, BLOCK_STALLING_TIMEOUT_MAX);
    5738 |              if (stalling_timeout != new_timeout && m_block_stalling_timeout.compare_exchange_strong(stalling_timeout, new_timeout)) {
    5739 | -                LogPrint(BCLog::NET, "Increased stalling timeout temporarily to %d seconds\n", m_block_stalling_timeout.load().count());
    5740 | +                LogPrint(BCLog::NET, "Increased stalling timeout temporarily to %d seconds\n", new_timeout.count());
    


    maflcko commented at 9:32 AM on January 28, 2023:

    nit (feel free to ignore): it is not recommended to use the count method on a symbol whose type is unknown or whose type can easily change in a refactor. (see comment in util/time.h)

    Otherwise, if the type changes to std::chrono::milliseconds, count() will no longer return the number of seconds.


    mzumsande commented at 10:37 PM on January 29, 2023:

    make sense, changed to count_seconds (or did you have something else in mind?)


    maflcko commented at 9:45 AM on January 30, 2023:

    Ticks<std::chrono::seconds> could be used as well, in theory. The only difference is that count_seconds is more strict at compile-time. count_seconds will refuse to compile if the precision is higher than seconds, while Ticks<std::chrono::seconds> truncates it.

    No strong opinion which one to use, unless you need a truncation already, in which case you are better off with Ticks.

  7. net_processing: simplify logging statement
    Also use count_seconds() instead of count() for type safety.
    b2a1e47744
  8. mzumsande force-pushed on Jan 29, 2023
  9. maflcko approved
  10. maflcko commented at 9:53 AM on January 30, 2023: member

    review ACK b2a1e477444bfb90328b353e89967ace6ef10918 🕧

    <details><summary>Show signature</summary>

    Signature:

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    review ACK b2a1e477444bfb90328b353e89967ace6ef10918 🕧
    -----BEGIN PGP SIGNATURE-----
    
    iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
    pUit2Qv/V8xz1BG6WizGuF0vhcwOlTAyBYDYpC+VsE3Yc5w9zNipOPOPQRpapj4R
    LLMXex8AlWILIVcQZ8hKqla244kASglpKPhHE/kSoX8DuMsEDE7VCKO/Tc9Kg+qh
    4/y4gX8gc/Zsj+v+lwCXGeQqeCJBqKCLlA4S86A+77QkcgM33hL+1ZYPVgq/nrNR
    skfGkGoXJi7XBqGTfih8UBw5gicCrwZCqcn7etV+3AidGzNXIvNp2aX/nVj2ywqu
    UCCJx75S1W+cYTRoGaI25Qot1QmKJ0EQQkWuB8IBk2CPy2xmpy0qqR1tk76KxB9o
    Ecro1NKYEq0o8//OTuEYoctqfLkYf8Laaioux7PeLaHI3RjVZKBVlnekJKfu5uM2
    IdMlobeu5qPzLXklh5YGeKQ2LB7XWkuzBm5ha2b5Xze+RgDhWS5xa7le+FWwWLV+
    AkdFLx2lW+dR+eUOeCNQ1qKAFYPhpCFETzRLS58wBieNAd3JOTXI74Nu19qPqfk+
    9VjCKV8S
    =LYeM
    -----END PGP SIGNATURE-----
    

    </details>

  11. maflcko merged this on Jan 30, 2023
  12. maflcko closed this on Jan 30, 2023

  13. sidhujag referenced this in commit 0f4f31a4f0 on Jan 30, 2023
  14. mzumsande deleted the branch on Jan 30, 2023
  15. Fabcien referenced this in commit 3a33b4bd41 on Jan 4, 2024
  16. bitcoin locked this on Jan 30, 2024

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: 2026-04-17 03:13 UTC

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