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
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
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.