diff options
author | Mikael Pettersson <[email protected]> | 2018-03-10 16:19:26 +0100 |
---|---|---|
committer | Mikael Pettersson <[email protected]> | 2018-03-10 16:19:26 +0100 |
commit | 9f1d9a497ba42df8c122bc1ac2c1add6f64a164c (patch) | |
tree | 77aac2df6465a219921ca9d5d3e94732aa31c7fe /lib/dialyzer/test/r9c_SUITE_data/src | |
parent | 87a43e0a2039b31887a40e2c7dcfa03788b6acd9 (diff) | |
download | otp-9f1d9a497ba42df8c122bc1ac2c1add6f64a164c.tar.gz otp-9f1d9a497ba42df8c122bc1ac2c1add6f64a164c.tar.bz2 otp-9f1d9a497ba42df8c122bc1ac2c1add6f64a164c.zip |
make erlang:process_info/1 not retrieve messages
process_info/1 retrieves a number of properties related to a process,
including the list of messages in its mailbox. This is potentially
unsafe if the target process has a large number of queued messages:
- there is no a priori upper bound on the amount of memory being
allocated to hold that list, and
- the loop to retrieve the messages is uninterruptible, so the
Erlang scheduler where this executes blocks for the duration
We've seen process_info/1 bring down heavily loaded nodes on more
than one occasion. At least once it appeared to have blocked the
Erlang heart process from executing, causing the external heart to
kill the VM.
Consequently this removes 'messages' from the list of process_info
tags to retrieve for process_info/1. Note that process_info/1 still
retrieves 'message_queue_len', and process_info/2 can still retrieve
'messages' when asked to.
A few places in the OTP libraries need minor adjustments, since they
want 'message_queue_len' but compute it from the length of the list
of messages.
Diffstat (limited to 'lib/dialyzer/test/r9c_SUITE_data/src')
-rw-r--r-- | lib/dialyzer/test/r9c_SUITE_data/src/mnesia/mnesia_tm.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dialyzer/test/r9c_SUITE_data/src/mnesia/mnesia_tm.erl b/lib/dialyzer/test/r9c_SUITE_data/src/mnesia/mnesia_tm.erl index 09e310530d..af49ceff72 100644 --- a/lib/dialyzer/test/r9c_SUITE_data/src/mnesia/mnesia_tm.erl +++ b/lib/dialyzer/test/r9c_SUITE_data/src/mnesia/mnesia_tm.erl @@ -2051,7 +2051,7 @@ display_pid_info(Pid) -> Other end, Reds = fetch(reductions, Info), - LM = length(fetch(messages, Info)), + LM = fetch(message_queue_len, Info), pformat(io_lib:format("~p", [Pid]), io_lib:format("~p", [Call]), io_lib:format("~p", [Curr]), Reds, LM) |