p2p_disconnect_ban intermittent issue #26808

issue maflcko openend this issue on January 4, 2023
  1. maflcko commented at 11:35 am on January 4, 2023: member

    https://cirrus-ci.com/task/5426348117196800?logs=ci#L4502

     0 test  2022-12-17T13:12:20.699000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: '''' 
     1                                           self.wait_until(lambda: sum(peer['version'] != 0 for peer in to_connection.getpeerinfo()) == to_num_peers)
     2                                   '''
     3 test  2022-12-17T13:12:20.699000Z TestFramework (ERROR): Assertion failed 
     4                                   Traceback (most recent call last):
     5                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 134, in main
     6                                       self.run_test()
     7                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/p2p_disconnect_ban.py", line 112, in run_test
     8                                       self.connect_nodes(0, 1)  # reconnect the node
     9                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 608, in connect_nodes
    10                                       self.wait_until(lambda: sum(peer['version'] != 0 for peer in to_connection.getpeerinfo()) == to_num_peers)
    11                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 732, in wait_until
    12                                       return wait_until_helper(test_function, timeout=timeout, timeout_factor=self.options.timeout_factor)
    13                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/util.py", line 281, in wait_until_helper
    14                                       raise AssertionError("Predicate {} not true after {} seconds".format(predicate_source, timeout))
    15                                   AssertionError: Predicate ''''
    16                                           self.wait_until(lambda: sum(peer['version'] != 0 for peer in to_connection.getpeerinfo()) == to_num_peers)
    17                                   ''' not true after 2400.0 seconds
    
  2. maflcko added the label Bug on Jan 4, 2023
  3. maflcko added the label Tests on Jan 4, 2023
  4. fanquake commented at 11:51 am on January 17, 2023: member
  5. maflcko renamed this:
    p2p_disconnect_ban issue
    p2p_disconnect_ban intermittent issue
    on Jan 18, 2023
  6. maflcko referenced this in commit d91364fdd9 on Jan 18, 2023
  7. brunoerg commented at 2:49 pm on February 17, 2023: contributor
    0self.log.info("disconnectnode: successfully disconnect node by address")
    1address1 = self.nodes[0].getpeerinfo()[0]['addr']
    2self.nodes[0].disconnectnode(address=address1)
    3self.wait_until(lambda: len(self.nodes[0].getpeerinfo()) == 1, timeout=10)
    4assert not [node for node in self.nodes[0].getpeerinfo() if node['addr'] == address1]
    

    We call disconnectnode and check if it worked by getpeerinfo. Perhaps, internally is it updating the informations before really compliting the disconnection? So, when node0 call disconnectnode (to disconnect node1) we could check whether it really disconnected by checking getpeerinfo for node1?

    E.g.: Here we first remove from m_nodes (so getpeerinfo won’t return that node anymore) and then we do the rest:

     0 if (pnode->fDisconnect)
     1  {
     2      // remove from m_nodes
     3      m_nodes.erase(remove(m_nodes.begin(), m_nodes.end(), pnode), m_nodes.end());
     4
     5      // release outbound grant (if any)
     6      pnode->grantOutbound.Release();
     7
     8      // close socket and cleanup
     9      pnode->CloseSocketDisconnect();
    10
    11      // hold in disconnected pool until all refs are released
    12      pnode->Release();
    13      m_nodes_disconnected.push_back(pnode);
    14  }
    
  8. fanquake closed this on Feb 20, 2023

  9. sidhujag referenced this in commit c37110e733 on Feb 25, 2023
  10. bitcoin locked this on Feb 20, 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: 2024-11-21 09:12 UTC

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