Please sign in to comment.
Remove the client ref when it dies
We have observed periods of couchjs processes spiking into the hundreds and thousands for short periods of time since the new couch_proc_manager was released. Today I happened to catch one in the act and poked at couch_proc_manager's ets table. There seemed to be a few more couchjs processes with clients than I would have expected so I skimmed the code looking for a place where we didn't clear the client value (which would prevent it from being reused so that it would eventually just timeout). I found a case where if the Pid that checked out the process dies without the OS process dying, we were forgetting to clear the client in the ets table. This patch refactors the two places we return processes into a single function call which clears the OS process client.
- Loading branch information...
Showing with 12 additions and 9 deletions.