Skip to content

test: fix intermittent failure in p2p_getaddr_caching.py - #28144

Merged
fanquake merged 2 commits into
bitcoin:masterfrom
mzumsande:202307_getaddr_caching_fix
Aug 1, 2023
Merged

fanquake merged 2 commits into
bitcoin:masterfrom
mzumsande:202307_getaddr_caching_fix

Conversation

@mzumsande

@mzumsande mzumsande commented Jul 25, 2023 •

Copy link
Copy Markdown
Contributor

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 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).

@DrahtBot

DrahtBot commented Jul 25, 2023 •

Copy link
Copy Markdown
Contributor

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

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK vasild
Concept ACK jonatack

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

@DrahtBot DrahtBot added the Tests label Jul 25, 2023
@mzumsande mzumsande changed the title test: fix intermittent timeout in p2p_getaddr_caching.py test: fix intermittent failure in p2p_getaddr_caching.py Jul 25, 2023
@mzumsande
mzumsande force-pushed the 202307_getaddr_caching_fix branch from 73c6d9d to e4d3787 Compare July 25, 2023 01:17
@jonatack

Copy link
Copy Markdown
Member

Concept ACK, thank you for looking into it.

@maflcko
maflcko requested a review from vasild July 25, 2023 05:48
@maflcko maflcko added this to the 26.0 milestone Jul 25, 2023

@vasild vasild 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.

ACK e4d37875e6a440748623250d77ec3be523a1d34d

Today I learned something new: it is possible to have duplicate (srcaddr, srcport) for TCP connections if the destination is different. Thank you!

Comment thread test/functional/p2p_getaddr_caching.py Resolved
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.
@mzumsande
mzumsande force-pushed the 202307_getaddr_caching_fix branch from e4d3787 to 8a20f76 Compare July 25, 2023 14:47
@mzumsande

Copy link
Copy Markdown
Contributor Author

e4d3787 to 8a20f76: Addressed feedback, thanks!

Today I learned something new: it is possible to have duplicate (srcaddr, srcport) for TCP connections if the destination is different. Thank you!

I was also surprised by this!

@vasild vasild 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.

ACK 8a20f76

@fanquake
fanquake merged commit 1b5cbf7 into bitcoin:master Aug 1, 2023
@bitcoin bitcoin locked and limited conversation to collaborators Jul 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

p2p_getaddr_caching.py failure in TSan CI

6 participants