From cdf43ab5a1d5ea21e42302c848fe4f07150e6947 Mon Sep 17 00:00:00 2001 From: "Damien F. Katz" Date: Thu, 9 Apr 2009 21:37:23 +0000 Subject: Fix for attachment sparseness bug COUCHDB-220 by giving each attachment it's own stream and calling set_min_buffer instead of ensure_buffer. Also fixed spurious couch_file crash messages by putting the statistics decrement code into a seperate monitoring process. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@763816 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_stats_collector.erl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/couchdb/couch_stats_collector.erl') diff --git a/src/couchdb/couch_stats_collector.erl b/src/couchdb/couch_stats_collector.erl index 8d0234bb..854fffb0 100644 --- a/src/couchdb/couch_stats_collector.erl +++ b/src/couchdb/couch_stats_collector.erl @@ -56,13 +56,17 @@ increment({Module, Key}) when is_integer(Key) -> increment({Module, list_to_atom(integer_to_list(Key))}); increment(Key) -> case catch ets:update_counter(?HIT_COUNTER_TABLE, Key, 1) of - {'EXIT', {badarg, _}} -> ets:insert(?HIT_COUNTER_TABLE, {Key, 1}); + {'EXIT', {badarg, _}} -> + true = ets:insert(?HIT_COUNTER_TABLE, {Key, 1}), + ok; _ -> ok end. decrement(Key) -> case catch ets:update_counter(?HIT_COUNTER_TABLE, Key, -1) of - {'EXIT', {badarg, _}} -> ets:insert(?HIT_COUNTER_TABLE, {Key, -1}); + {'EXIT', {badarg, _}} -> + true = ets:insert(?HIT_COUNTER_TABLE, {Key, -1}), + ok; _ -> ok end. -- cgit v1.2.3