Fix race condition on test node shutdown #6509

Merged
merged 1 commit into from Aug 17, 2015

Conversation

Projects
None yet
3 participants
@casey
Contributor

casey commented Aug 3, 2015

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.

@sdaftuar

This comment has been minimized.

Show comment
Hide comment
@sdaftuar

sdaftuar Aug 5, 2015

Member

utACK

Member

sdaftuar commented Aug 5, 2015

utACK

@laanwj

View changes

qa/rpc-tests/test_framework/comptool.py
+ def wait_for_disconnections(self):
+ def disconnected():
+ return all(node.closed for node in self.test_nodes)
+ wait_until(disconnected, timeout=10)

This comment has been minimized.

@laanwj

laanwj Aug 12, 2015

Member

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

@laanwj

laanwj Aug 12, 2015

Member

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

This comment has been minimized.

@casey

casey Aug 12, 2015

Contributor

Seems reasonable to me, changed.

@casey

casey Aug 12, 2015

Contributor

Seems reasonable to me, changed.

@laanwj laanwj merged commit 45a6cce into bitcoin:master Aug 17, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Aug 17, 2015

Merge pull request #6509
45a6cce Fix race condition on test node shutdown (Casey Rodarmor)

@laanwj laanwj referenced this pull request Aug 21, 2015

Merged

Add p2p-fullblocktest.py #6523

@dagurval dagurval referenced this pull request in bitcoinxt/bitcoinxt Aug 9, 2017

Merged

Add comptool.RejectResult #238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment