Update quickcheck to use blocking/1 and fix uncovered bug #15

Merged
merged 1 commit into from Aug 31, 2012

3 participants

@Vagabond
Collaborator

Blocking/1 was added in quickcheck 1.27 and allows the test to indicate
which states might block execution and lets quickcheck find bugs around
them.

The bug uncovered has to do with when a process holding a worker exits,
the DOWN monitor fires and poolboy calls supervisor:terminate_child on
the worker the process held. When the EXIT message comes in for that
process, we then change the state around such that there is an
additional worker.

This caused a race condition if there were already checkout messages
waiting in the mailbox, because the EXIT message would come in behind
the checkout messages, and so even though we had just killed a worker,
we'd fail checkouts because we hadn't processed the EXIT yet.

The fix is to call into handle_worker_exit right after we terminate the
worker, thus updating our state to reflect the actual worker count
before processing any messages in the mailbox.

@Vagabond Vagabond Update quickcheck to use blocking/1 and fix uncovered bug
Blocking/1 was added in quickcheck 1.27 and allows the test to indicate
which states might block execution and lets quickcheck find bugs around
them.

The bug uncovered has to do with when a process holding a worker exits,
the DOWN monitor fires and poolboy calls supervisor:terminate_child on
the worker the process held. When the EXIT message comes in for that
process, we then change the state around such that there is an
additional worker.

This caused a race condition if there were already checkout messages
waiting in the mailbox, because the EXIT message would come in behind
the checkout messages, and so even though we had just killed a worker,
we'd fail checkouts because we hadn't processed the EXIT yet.

The fix is to call into handle_worker_exit right after we terminate the
worker, thus updating our state to reflect the actual worker count
before processing any messages in the mailbox.
3acb457
@travisbot

This pull request passes (merged 3acb457 into 6294c7d).

@devinus devinus merged commit c8f3f83 into master Aug 31, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment