aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mnesia/test
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2015-10-02 13:47:41 +0200
committerDan Gudmundsson <[email protected]>2015-10-02 13:47:41 +0200
commitd22396bce11debcbb6d8826468bd111ac0efbf7b (patch)
treef0384763e82f8e5c79a5b35753845edc62f9ad8b /lib/mnesia/test
parent1523be48ab4071b158412f4b06fe9c8d6ba3e73c (diff)
downloadotp-d22396bce11debcbb6d8826468bd111ac0efbf7b.tar.gz
otp-d22396bce11debcbb6d8826468bd111ac0efbf7b.tar.bz2
otp-d22396bce11debcbb6d8826468bd111ac0efbf7b.zip
mnesia: Fix mnesia:restore/2 which caused a disk_log leak
Introduced a leak of disk_log processes in the rewrite to try-catch.
Diffstat (limited to 'lib/mnesia/test')
-rw-r--r--lib/mnesia/test/mnesia_evil_backup.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/mnesia/test/mnesia_evil_backup.erl b/lib/mnesia/test/mnesia_evil_backup.erl
index 89f2861661..e605fa7926 100644
--- a/lib/mnesia/test/mnesia_evil_backup.erl
+++ b/lib/mnesia/test/mnesia_evil_backup.erl
@@ -232,7 +232,13 @@ restore(Config, Op) ->
Res21 = [{Tab2, N, N+1} || N <- lists:seq(1, 11)],
Res31 = [[{Tab3, N, N+1}, {Tab3, N, N+44}] || N <- lists:seq(1, 10)],
-
+ Check = fun() ->
+ [disk_log:pid2name(X) ||
+ X <- processes(), Data <- [process_info(X, [current_function])],
+ Data =/= undefined,
+ element(1, element(2, lists:keyfind(current_function, 1, Data)))=:= disk_log]
+ end,
+ Before = Check(),
?match({atomic, [Tab1]}, Restore(File1, [{Op, [Tab1]},
{skip_tables, Tabs -- [Tab1]}])),
case Op of
@@ -319,6 +325,8 @@ restore(Config, Op) ->
end,
?match(ok, file:delete(File1)),
?match(ok, file:delete(File2)),
+ ?match([], Check() -- Before),
+
?verify_mnesia(Nodes, []).