Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix ETS table race in ets_increment()

  • Loading branch information...
commit e370fb77cb6bb7860c54366681ec6ba80f7a789c 1 parent 2f6db29
@slfritchie slfritchie authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/basho_bench_stats.erl
View
9 src/basho_bench_stats.erl
@@ -214,8 +214,13 @@ ets_increment(Tab, Key, Incr) when is_integer(Incr) ->
Value when is_integer(Value) ->
ok;
{'EXIT', _} ->
- true = ets:insert_new(Tab, {Key, Incr}),
- ok
+ case ets:insert_new(Tab, {Key, Incr}) of
+ true ->
+ ok;
+ _ ->
+ %% Race with another load gen proc, so retry
+ ets_increment(Tab, Key, Incr)
+ end
end;
ets_increment(Tab, Key, Incr) when is_float(Incr) ->
Old = case ets:lookup(Tab, Key) of
Please sign in to comment.
Something went wrong with that request. Please try again.