aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2013-03-27 14:58:01 +0100
committerSiri Hansen <[email protected]>2013-03-27 14:58:01 +0100
commitca333ac936081cf39137bb657383c4f06ad809d3 (patch)
tree773a1f21436050cdda14bbd1489ba878653f2dd4
parentdef9f08b475c24f65980b0b1efcf39f7ed7064c9 (diff)
parent42c31ab4bfcd74d7139f90ea1b03a35048cacef6 (diff)
downloadotp-ca333ac936081cf39137bb657383c4f06ad809d3.tar.gz
otp-ca333ac936081cf39137bb657383c4f06ad809d3.tar.bz2
otp-ca333ac936081cf39137bb657383c4f06ad809d3.zip
Merge branch 'siri/cover/hanging-proc/OTP-10979' into maint
* siri/cover/hanging-proc/OTP-10979: [cover] Ensure no process leak when stopping cover on dead node
-rw-r--r--lib/tools/src/cover.erl11
-rw-r--r--lib/tools/test/cover_SUITE.erl26
2 files changed, 31 insertions, 6 deletions
diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl
index dfcfc3675f..c2c627abe0 100644
--- a/lib/tools/src/cover.erl
+++ b/lib/tools/src/cover.erl
@@ -1139,9 +1139,14 @@ remote_collect(Module,Nodes,Stop) ->
do_collection(Node, Module, Stop) ->
CollectorPid = spawn(fun collector_proc/0),
- remote_call(Node,{remote,collect,Module,CollectorPid, self()}),
- if Stop -> remote_call(Node,{remote,stop});
- true -> ok
+ case remote_call(Node,{remote,collect,Module,CollectorPid, self()}) of
+ {error,node_dead} ->
+ CollectorPid ! done,
+ ok;
+ ok when Stop ->
+ remote_call(Node,{remote,stop});
+ ok ->
+ ok
end.
%% Process which receives chunks of data from remote nodes - either when
diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl
index 5abc5c41b1..c033be98a3 100644
--- a/lib/tools/test/cover_SUITE.erl
+++ b/lib/tools/test/cover_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -27,7 +27,8 @@
dont_reconnect_after_stop/1, stop_node_after_disconnect/1,
export_import/1,
otp_5031/1, eif/1, otp_5305/1, otp_5418/1, otp_6115/1, otp_7095/1,
- otp_8188/1, otp_8270/1, otp_8273/1, otp_8340/1]).
+ otp_8188/1, otp_8270/1, otp_8273/1, otp_8340/1,
+ otp_10979_hanging_node/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -52,7 +53,7 @@ all() ->
dont_reconnect_after_stop, stop_node_after_disconnect,
export_import, otp_5031, eif, otp_5305, otp_5418,
otp_6115, otp_7095, otp_8188, otp_8270, otp_8273,
- otp_8340];
+ otp_8340, otp_10979_hanging_node];
_pid ->
{skip,
"It looks like the test server is running "
@@ -1381,6 +1382,25 @@ comprehension_8188(Cf) ->
ok.
+otp_10979_hanging_node(_Config) ->
+
+ P1 = processes(),
+
+ cover:stop(non_existing_node),
+ cover:stop(),
+
+ P2 = processes(),
+
+ case P2--P1 of
+ [] ->
+ ok;
+ New ->
+ [io:format("New: ~p, ~p~n",[P,process_info(P)]) || P<-New],
+ ct:fail(hanging_process)
+ end,
+
+ ok.
+
%%--Auxiliary------------------------------------------------------------
analyse_expr(Expr, Config) ->