diff options
author | Dan Gudmundsson <[email protected]> | 2014-02-20 12:24:59 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2014-02-20 12:24:59 +0100 |
commit | 4c538e1a857d3dce7cbb8358f9ddd08b25db166e (patch) | |
tree | 4e9eda28ff01e32ed4828c0dce120b2322404359 /lib/kernel/test/application_SUITE_data/deadlock/deadlock.erl | |
parent | ae8e71d0f5fc999f2631c4878ebde0aac233641f (diff) | |
parent | 397e69fa95457f9660831ba1e551c784eb61e93e (diff) | |
download | otp-4c538e1a857d3dce7cbb8358f9ddd08b25db166e.tar.gz otp-4c538e1a857d3dce7cbb8358f9ddd08b25db166e.tar.bz2 otp-4c538e1a857d3dce7cbb8358f9ddd08b25db166e.zip |
Merge branch 'dgud/kernel/application-deadlock/OTP-11171'
* dgud/kernel/application-deadlock/OTP-11171:
kernel: Fix an application terminate deadlock possibility
Diffstat (limited to 'lib/kernel/test/application_SUITE_data/deadlock/deadlock.erl')
-rw-r--r-- | lib/kernel/test/application_SUITE_data/deadlock/deadlock.erl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/kernel/test/application_SUITE_data/deadlock/deadlock.erl b/lib/kernel/test/application_SUITE_data/deadlock/deadlock.erl index 5f68bf9078..3ef6105371 100644 --- a/lib/kernel/test/application_SUITE_data/deadlock/deadlock.erl +++ b/lib/kernel/test/application_SUITE_data/deadlock/deadlock.erl @@ -21,7 +21,7 @@ init([sup]) -> {ok, {{one_for_one, 5, 10}, [ { sasl_syslog_dm, {?MODULE, start_link, []}, - permanent, brutal_kill, worker, + permanent, 25000, worker, [deadlock] } ]}}; @@ -32,6 +32,8 @@ init([sup]) -> init([child]) -> case application:get_env(deadlock, fail_start) of {ok, false} -> + process_flag(trap_exit, true), + io:format("~p: Traps exit~n",[?MODULE]), %% we must not fail on the first init, otherwise supervisor %% terminates immediately {ok, []}; @@ -50,6 +52,14 @@ handle_info(_Msg, State) -> {noreply, State}. terminate(_Reason, _State) -> + case application:get_env(deadlock, fail_stop) of + {ok, false} -> ok; + {ok, Tester} -> + Tester ! {deadlock, self()}, + io:format("~p: Waiting in terminate (~p)~n",[?MODULE,Tester]), + receive continue -> ok end + end, + io:format("~p: terminates~n", [?MODULE]), ok. code_change(_OldVsn, State, _Extra) -> |