Skip to content

Conversation

@mzumsande
Copy link
Contributor

Fixes #26552.

The problem was that calling disconnect_p2ps waits until self.num_test_p2p_connections() == 0.
num_test_p2p_connections() checks the field subver in getpeerinfo to distinguish p2p nodes from full nodes.
However, if we are dealing with a p2p connection that has never sent a version, the node has never received the special subversion and the wait is ineffective (we continue even though the disconnection is not yet completed).

Fix this by not using disconnect_p2ps.

The wait in disconnect_p2ps checked for subver, which
is unavailable for the peer that didn't send a version msg.
@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 21, 2022

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 MarcoFalke

@DrahtBot DrahtBot added the Tests label Nov 21, 2022
@maflcko
Copy link
Member

maflcko commented Nov 22, 2022

ACK 0f6cd72

@maflcko maflcko merged commit 7eeae5c into bitcoin:master Nov 22, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Nov 22, 2022
0f6cd72 test: Fix intermittent failure in rpc_net.py (Martin Zumsande)

Pull request description:

  Fixes bitcoin#26552.

  The problem was that calling `disconnect_p2ps` waits until `self.num_test_p2p_connections() == 0`.
  `num_test_p2p_connections()` checks the field `subver` in `getpeerinfo` to distinguish p2p nodes from full nodes.
  However, if we are dealing with a p2p connection that has never sent a version, the node has never received the special subversion and the wait is ineffective (we continue even though the disconnection is not yet completed).

  Fix this by not using `disconnect_p2ps`.

ACKs for top commit:
  MarcoFalke:
    ACK 0f6cd72

Tree-SHA512: ebdc78498db6971ae2f9b494dc76b35de46155bf191ce82ee04162592d0d9ec1272901992406d530fa46fb52cd815c4b91350824578292df14986584bc60b90a
@mzumsande mzumsande deleted the 202211_test_disconnect_wait branch November 22, 2022 15:46
@bitcoin bitcoin locked and limited conversation to collaborators Nov 22, 2023
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.

test: intermittent failure in rpc_net.py

3 participants