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
test: fix intermittent failure in p2p_getaddr_caching.py #28144
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
73c6d9d
to
e4d3787
Compare
Concept ACK, thank you for looking into it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK e4d3787
Today I learned something new: it is possible to have duplicate (srcaddr, srcport) for TCP connections if the destination is different. Thank you!
Only the combined addr:port of source and destination must be unique. If the destination is different, the same addr:port for the source may be used by the OS.
python p2p instances will automatically send a getaddr msg after connecting, the explicit message was a duplicate that was being ignored.
e4d3787
to
8a20f76
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 8a20f76
…ching.py 8a20f76 test: drop duplicate getaddrs from p2p_getaddr_caching (Martin Zumsande) feb0096 test: fix intermittent failure in p2p_getaddr_caching (Martin Zumsande) Pull request description: Fixes bitcoin#28133 In the consistency check, it's not enough to check that our address/port is unique, only the combination of source and target must be unique. Otherwise, the OS may reuse ports for connections to different `-addrbind`, which was happening in the failed runs. While at it, the second commit cleans up duplicate `getaddr` messages in `p2p_getaddr_caching.py` that do nothing but generate `Ignoring repeated "getaddr"` log messages (and cleans up some whitespace the python linter complains about). ACKs for top commit: vasild: ACK 8a20f76 Tree-SHA512: eabe4727d7887f729074076f6333a918bba8cb34b8e3baaa83f167b441b0daa24f7c4824abcf03a9538a2ef14b2d826ff19aeffcb93a6c20735253a9678aac9c
Fixes #28133
In the consistency check, it's not enough to check that our address/port is unique, only the combination of source and target must be unique. Otherwise, the OS may reuse ports for connections to different
-addrbind
, which was happening in the failed runs.While at it, the second commit cleans up duplicate
getaddr
messages inp2p_getaddr_caching.py
that do nothing but generateIgnoring repeated "getaddr"
log messages (and cleans up some whitespace the python linter complains about).