aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2017-12-18 15:30:39 +0100
committerDan Gudmundsson <[email protected]>2017-12-18 15:30:39 +0100
commite038b56530804a3e59cc8832db64e021b4b33d25 (patch)
tree5e2df4288d7fb376a93edd38e7356696ccc04967
parent3a14bb468b1f3f1f5bef3c18291fe0498429a417 (diff)
downloadotp-e038b56530804a3e59cc8832db64e021b4b33d25.tar.gz
otp-e038b56530804a3e59cc8832db64e021b4b33d25.tar.bz2
otp-e038b56530804a3e59cc8832db64e021b4b33d25.zip
mnesia: Fix checkpoint crash
Bad timing can cause retain messages to go to a new process if checkpoint name is reused directly and the checkpoints contain different tables. Ignore those messages instead of crash.
-rw-r--r--lib/mnesia/src/mnesia_checkpoint.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mnesia/src/mnesia_checkpoint.erl b/lib/mnesia/src/mnesia_checkpoint.erl
index 2ff77326a9..8112378ffd 100644
--- a/lib/mnesia/src/mnesia_checkpoint.erl
+++ b/lib/mnesia/src/mnesia_checkpoint.erl
@@ -857,9 +857,9 @@ retainer_loop(Cp = #checkpoint_args{is_activated=false, name=Name}) ->
retainer_loop(Cp = #checkpoint_args{name=Name}) ->
receive
{_From, {retain, Tid, Tab, Key, OldRecs}} ->
- R = val({Tab, {retainer, Name}}),
+ R = ?catch_val({Tab, {retainer, Name}}),
PendingTab = Cp#checkpoint_args.pending_tab,
- case R#retainer.really_retain of
+ case is_record(R, retainer) andalso R#retainer.really_retain of
true ->
Store = R#retainer.store,
try true = ets:member(PendingTab, Tid),