Fix race condition on test node shutdown #6509

pull casey wants to merge 1 commits into bitcoin:master from casey:comptool-race-condition changing 1 files +48 −46
  1. casey commented at 6:54 PM on August 3, 2015: contributor

    This fixes a race condition where the block store or the transaction store might be accessed after being closed. To fix this, we wait until all connections are closed before closing the stores.

    This race condition is tricky to trigger, but I hit it when writing an extended block acceptance test.

  2. laanwj added the label Tests on Aug 5, 2015
  3. sdaftuar commented at 3:15 PM on August 5, 2015: member

    utACK

  4. Fix race condition on test node shutdown 45a6cce971
  5. in qa/rpc-tests/test_framework/comptool.py:None in 12d9715966 outdated
     169 | +            test_node.add_connection(self.connections[-1])
     170 | +
     171 | +    def wait_for_disconnections(self):
     172 | +        def disconnected():
     173 | +            return all(node.closed for node in self.test_nodes)
     174 | +        wait_until(disconnected, timeout=10)
    


    laanwj commented at 7:46 AM on August 12, 2015:

    Maybe return wait_until so that callers know whether it succeeded or timed out? (same for other wait_for_XXX)


    casey commented at 3:03 PM on August 12, 2015:

    Seems reasonable to me, changed.

  6. laanwj merged this on Aug 17, 2015
  7. laanwj closed this on Aug 17, 2015

  8. laanwj referenced this in commit bb4faee21e on Aug 17, 2015
  9. DrahtBot locked this on Sep 8, 2021
Labels

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: 2026-05-02 03:15 UTC

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