aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2010-10-19 13:12:06 +0200
committerHans Bolinder <[email protected]>2010-10-21 09:37:00 +0200
commitac96033fc95304a43813cd5a4a75aeefe6299a2d (patch)
treea280a41b31615f5a715887c3f97c014b6904bff8 /lib/stdlib/src
parent42a5c23e7beabf08ac8d9796da63386a8af95456 (diff)
downloadotp-ac96033fc95304a43813cd5a4a75aeefe6299a2d.tar.gz
otp-ac96033fc95304a43813cd5a4a75aeefe6299a2d.tar.bz2
otp-ac96033fc95304a43813cd5a4a75aeefe6299a2d.zip
Fix a bug that could cause 'bad_object' errors
When several clients accessed a Dets table simultaneously, modifications of the Dets server's internal state were sometimes thrown away. The symptoms are diverse: error with reason 'bad_object'; inserted objects not returned by lookup(); et cetera.
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/dets.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/stdlib/src/dets.erl b/lib/stdlib/src/dets.erl
index 4584b8184f..1d4d664841 100644
--- a/lib/stdlib/src/dets.erl
+++ b/lib/stdlib/src/dets.erl
@@ -1094,7 +1094,9 @@ do_apply_op(Op, From, Head, N) ->
{N2, H2} when is_record(H2, head), is_integer(N2) ->
open_file_loop(H2, N2);
H2 when is_record(H2, head) ->
- open_file_loop(H2, N)
+ open_file_loop(H2, N);
+ {{more,From1,Op1,N1}, NewHead} ->
+ do_apply_op(Op1, From1, NewHead, N1)
catch
exit:normal ->
exit(normal);
@@ -1438,7 +1440,7 @@ stream_end2([], Ps, no_more, N, C, Head, _Reply) ->
penalty(Head, Ps, C),
{N, Head};
stream_end2([], _Ps, {From, Op}, N, _C, Head, _Reply) ->
- apply_op(Op, From, Head, N).
+ {{more,From,Op,N},Head}.
penalty(H, _Ps, _C) when H#head.fixed =:= false ->
ok;