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
[qa] Handle disconnect_node race #13201
Conversation
Several tests call disconnect_nodes() on each node-pair in rapid succession, resulting in a race condition if a node disconnects a peer in-between the calculation of the nodeid's to disconnect and the invocation of the disconnectnode rpc call. Handle this.
I believe I encountered the race condition I describe in the OP during a run of the
So we're telling node0 to disconnect from node1 first, and then we're telling node1 to disconnect from node0. Note that the calculation of which nodes to disconnect node1 from (which happens in the node1.getpeerinfo() call) is before node1 disconnects node0, but we actual call node1.disconnectnode() after that. @jnewbery Does this look right to you? |
utACK 09c6699. Seems reasonable - the only way we can receive a |
Making disconnection idempotent seems a good idea. utACK 09c6699 |
utACK 09c6699. Nice fixup, that should be backported |
09c6699 [qa] Handle disconnect_node race (Suhas Daftuar) Pull request description: Several tests call disconnect_nodes() on each node-pair in rapid succession, resulting in a race condition if a node disconnects a peer in-between the calculation of the nodeid's to disconnect and the invocation of the disconnectnode rpc call. Handle this. Tree-SHA512: 3078cea0006fcb507c812004a777c505eb1e9dda7c6df12dbbe72395a73ff6f6760f597b6492054f5487b34534417ddef5fbad30553c135c288c4b7cfce79223
Several tests call disconnect_nodes() on each node-pair in rapid succession, resulting in a race condition if a node disconnects a peer in-between the calculation of the nodeid's to disconnect and the invocation of the disconnectnode rpc call. Handle this. GitHub-Pull: bitcoin#13201 Rebased-From: 09c6699
acdf433 Hold cs_main while calling UpdatedBlockTip() and ui.NotifyBlockTip (Jesse Cohen) 5ff571e [wallet] [tests] Test disallowed multiwallet params (John Newbery) 4c14e7b [wallet] Fix zapwallettxes/multiwallet interaction. (John Newbery) 4087dd0 RPC Docs: gettxout*: clarify bestblock and unspent counts (David A. Harding) b8aacd6 [qa] Handle disconnect_node race (Suhas Daftuar) Pull request description: Backports: - #13201 [qa] Handle disconnect_node race - #13184 RPC Docs: gettxout*: clarify bestblock and unspent counts - #13030 [bugfix] [wallet] Fix zapwallettxes/multiwallet interaction. - #12988 Hold cs_main while calling UpdatedBlockTip() signal to the 0.16 branch. Tree-SHA512: 8f65002bbafaf9c436f89051b2d79bf6a668fbd07bd317c64af238ed4a7c8efe776864b739a7f2869f1e3daa16f2f4366a85f41b188f9c454879d2c7b309be50
Several tests call disconnect_nodes() on each node-pair in rapid succession, resulting in a race condition if a node disconnects a peer in-between the calculation of the nodeid's to disconnect and the invocation of the disconnectnode rpc call. Handle this. GitHub-Pull: bitcoin#13201 Rebased-From: 09c6699
Summary: 09c6699 [qa] Handle disconnect_node race (Suhas Daftuar) Pull request description: Several tests call disconnect_nodes() on each node-pair in rapid succession, resulting in a race condition if a node disconnects a peer in-between the calculation of the nodeid's to disconnect and the invocation of the disconnectnode rpc call. Handle this. Tree-SHA512: 3078cea0006fcb507c812004a777c505eb1e9dda7c6df12dbbe72395a73ff6f6760f597b6492054f5487b34534417ddef5fbad30553c135c288c4b7cfce79223 Backport of Core PR13201 bitcoin/bitcoin#13201 Test Plan: test_runner.py Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D4119
09c6699 [qa] Handle disconnect_node race (Suhas Daftuar) Pull request description: Several tests call disconnect_nodes() on each node-pair in rapid succession, resulting in a race condition if a node disconnects a peer in-between the calculation of the nodeid's to disconnect and the invocation of the disconnectnode rpc call. Handle this. Tree-SHA512: 3078cea0006fcb507c812004a777c505eb1e9dda7c6df12dbbe72395a73ff6f6760f597b6492054f5487b34534417ddef5fbad30553c135c288c4b7cfce79223
Several tests call disconnect_nodes() on each node-pair in rapid
succession, resulting in a race condition if a node disconnects a peer
in-between the calculation of the nodeid's to disconnect and the
invocation of the disconnectnode rpc call. Handle this.