Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Aug 31, 2012
  1. @Vagabond

    Update quickcheck to use blocking/1 and fix uncovered bug

    Vagabond authored
    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.
Commits on Aug 8, 2012
  1. @Vagabond

    Fix bugs added by using the ETS table found by quickcheck

    Vagabond authored
    Additionally, fix some minor issues in the quickcheck test
Commits on Jul 4, 2012
  1. @jamesgolick
Commits on Apr 27, 2012
  1. @devinus

    Several additions and improvements

    devinus authored
    - Change a `queue:len/1` call during a checkout in the ready state to use
      `queue:is_empty/1`. All operations in poolboy that aren't informational
      or disaster recovery should now theoretically be O(1).
    - There is now "transaction" support using `transaction/2`. This will
      run a user defined function passed the worker checked out in a try
      block, ensuring that the worker is checked back into the pool should
      the operation fail.
    - A `child_spec/2` helper for embedding poolboy pools  within your
      supervisors.
    - Documentation updates.
  2. @devinus

    Performance improvements and simplifications

    devinus authored
    - Monitors are now stored in an ETS table. Simple profiling revealed
      that a lot of time was being taken in `lists:keytake/3` looking up the
      refs by pid. This should provide O(1) constant time lookup.
    - Workers are now no longer required to handle `stop` messages. Workers
      are terminated using `supervisor:terminate_child/2` and the shutdown
      strategy is no longer brutal_kill.
    - Other various cleanups.
Commits on Mar 22, 2012
  1. @devinus

    Add poolboy_worker behaviour

    devinus authored
  2. @devinus

    Convert some tabs to spaces

    devinus authored
Commits on Jan 31, 2012
  1. @Vagabond

    Fix issue where the wrong pid was being stored in the list of monitors

    Vagabond authored
    When a pid exited while the pool was full and there were blocking
    checkouts, poolboy would put the pid of the process requesting a worker
    in the monitor tuple along with the monitor ref, instead of the pid of
    the worker.
Commits on Jan 22, 2012
  1. @Vagabond

    Add a parallel property for poolboy

    Vagabond authored
    To trigger some of the more interesting code, we need to truly do things
    in parallel, so blocking checkouts can actually happen while other
    requests are being made. This commit adds a parallel property for
    poolboy, based on the original serial one.
    
    One hack that was needed was to add a trailing call to erlang:self() to
    the end of each parallel branch so that we could filter out workers
    checked out by that particular branch from the model. This is necessary
    because poolboy monitors the process holding the worker and will destroy
    any workers held by a process and re-start them, if necessary, to
    maintain the right number of workers in the pool. This filtering is done
    in the next_state command, and all elements in the checked_out list in
    the model are tuples of {Worker, self()} so the list can be filtered.
    
    Happily, although this exercises more core, no additional bugs were
    found.
  2. @Vagabond

    Checkin non-worker processes 10% of the time and fix resulting bugs

    Vagabond authored
    Checking in an invalid process corrupts the internal state similarly to
    receiving EXITs from non-worker pids.
  3. @Vagabond

    Add command to send poolboy EXIT messages for unrelated pids; fix bugs

    Vagabond authored
    Sending poolboy EXIT messages for pids that are not workers causes
    invalid changes to poolboy's state. Also, legitimate processes dying
    after being checked back in also would corrupt the internal state. Add
    better checking in the EXIT handling code to guard against this.
  4. @Vagabond

    Add command to kill workers after they're checked back in, and fix bugs

    Vagabond authored
    Extend the 'status' to check the number of monitors poolboy has on
    processes that have checked out workers. When a process dies after being
    checked back in, poolboy zeroes out the list of monitors for some reason.
  5. @Vagabond

    Add kill_worker and fix resulting bugs

    Vagabond authored
    kill_worker exposed some new faults in poolboy, where the maximum size
    of the pool could end up smaller than it should be after a worker was
    killed.
    
    To help in debugging this, a 'status' command was added to poolboy to
    look at its internal state and a dynamic_precondition function was used
    to compare the expected state to the actual state.
    
    Numerous problems were discovered by doing this, poolboy had issues
    around when it changed states, like allocating the last non-overflow
    worker would leave the pool in 'ready' until the next request came in,
    instead of immediately changing the state.
Commits on Jan 21, 2012
  1. @Vagabond

    Add blocking checkout to quickcheck test and fix poolboy bug

    Vagabond authored
    The bug discovered was that blocking checkouts that had expired were not
    being removed from the list of 'waiting' checkouts, so when a checkout
    had timed out and a worker was subsequently checked in, the new worker
    would be sent to the expired checkout request, not any current ones.
  2. @Vagabond

    Initial quickcheck test for poolboy

    Vagabond authored
    For now, only test the simplest API; start, stop, checkout nonblocking
    and checkin.
Commits on Dec 27, 2011
Commits on Sep 30, 2011
  1. Merge cleanup and try to cleanup the tests

    Devin Torres authored
Commits on Sep 29, 2011
Commits on Sep 27, 2011
  1. @skeltoac

    Fix demonitored pids being left in state space and check monitor list…

    skeltoac authored
    … length in all tests. Add user_death test to check that an orphaned worker is killed when a monitored user is reported 'DOWN'.
Commits on Aug 25, 2011
  1. its -> it's

    Devin Torres authored
Commits on Aug 23, 2011
  1. @Vagabond
Commits on Aug 19, 2011
  1. @Vagabond
Commits on Aug 12, 2011
  1. @Vagabond

    Add tests & some hooks to poolboy to let the tests check the pool state

    Vagabond authored
    A bunch of these tests will fail against vanilla poolboy right now.
Something went wrong with that request. Please try again.