summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2014-06-26 19:49:30 -0400
committerRobert Newson <rnewson@apache.org>2014-07-23 18:08:32 +0100
commit096f0cfb1a6f85880685b7b65d44f00a582436d3 (patch)
tree773e46033539337cc394673358688729f265e2b8
parent9a1bbd09334dc869d45eed9331cb61432f116ca5 (diff)
downloadcouchdb-096f0cfb1a6f85880685b7b65d44f00a582436d3.tar.gz
Fix error_limit = 0, and make it the default
Setting the error_limit to 0 would previously cause rexi_server to crash on the next error because of an unhandled exception in a queue:drop/1. This fixes that exception and makes a limit of 0 the default. Operators can still raise the limit to capture errors in the future if we end up finding that useful. BugzID: 30821
-rw-r--r--src/rexi_server.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rexi_server.erl b/src/rexi_server.erl
index 3bb85a0ca..5f9976d9a 100644
--- a/src/rexi_server.erl
+++ b/src/rexi_server.erl
@@ -32,7 +32,7 @@
workers = ets:new(workers, [private, {keypos, #job.worker}]),
clients = ets:new(clients, [private, {keypos, #job.client}]),
errors = queue:new(),
- error_limit = 20,
+ error_limit = 0,
error_count = 0
}).
@@ -151,6 +151,8 @@ init_p(From, {M,F,A}, Nonce) ->
%% internal
+save_error(_E, #st{error_limit = 0} = St) ->
+ St;
save_error(E, #st{errors=Q, error_limit=L, error_count=C} = St) when C >= L ->
St#st{errors = queue:in(E, queue:drop(Q))};
save_error(E, #st{errors=Q, error_count=C} = St) ->