GitHub user davisp opened a pull request:
https://github.com/apache/couchdb-couch/pull/5
2322 fix couch proc manager limits
This fixes the couch_proc_manager limit counting by rearranging the
increment and decrements when processes are created and destroyed. It ensures
that each time we remove a process from the ets table that we decrement
appropriately.
For incrementing things are a bit more complicated in that we need to
increment before inserting to the table. This is so that our hard limit applies
even if one of our asynchronous spawn calls is opening a new process. This is
accomplished by incrementing the counter and storing the async open call
information in a new ets table. If the open is successful the counter is left
untouched. If the open fails then we need to decrement the counter.
This also simplifies starting waiting clients when a processes is either
returned, exits, or fails to start by isolating the logic and calling it in
each place as necessary.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/davisp/couchdb-couch
2322-fix-couch-proc-manager-limits
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-couch/pull/5.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #5
----
commit 28a7f57538b9dc7eb05d9c6e2ab2f275dd04ce35
Author: Paul J. Davis <[email protected]>
Date: 2014-09-05T22:34:28Z
Fix export declarations
commit a8263fe8d1c166a03a705847c224969440068c5e
Author: Paul J. Davis <[email protected]>
Date: 2014-09-05T22:35:14Z
Fix bugs with couch_proc_manager limits
The merge left about three features in the couch_proc_manager at odds
which ended up preventing the proper counting of live processes. This
could and does lead to deadlocks as waiters are never provided a process
for use.
Closes COUCHDB-2321
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---