From 8ed0d75c186d9da24bd6cfb85732487b17a3b054 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 23 Nov 2017 15:05:34 +0100 Subject: erts: Fix erlang:monitor toward c-nodes by suppressing DOP_MONITOR_P, DOP_MONITOR_P_EXIT and DOP_DEMONITOR_P if not supported by the remote node. In 17e198d6ee60f7dec9abfed272cf4226aea44535 I changed the behavior of erlang:monitor to not raise badarg for c-nodes but instead create a monitor to only supervise the connection. But I forgot to prevent DOP_MONITOR_P and friends from being sent to the node that does not expect them. Note: We test both DFLAG_DIST_MONITOR and DFLAG_DIST_MONITOR_NAME for the node to support process monitoring. This is because erl_interface is buggy as it sets DFLAG_DIST_MONITOR without really supporting it. ToDo: Should erl_interface stop setting DFLAG_DIST_MONITOR or should we change the meaning of these flags? --- erts/doc/src/erlang.xml | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 3b7b9d6a50..d78e75a91d 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -3358,25 +3358,6 @@ RealSystem = system + MissedSystem monitored process resides).

-

If an attempt is made to monitor a process on an older node - (where remote process monitoring is not implemented or - where remote process monitoring by registered name is not - implemented), the call fails with badarg.

- -

The format of the 'DOWN' message changed in ERTS - 5.2 (Erlang/OTP R9B) for monitoring - by registered name. Element Object of - the 'DOWN' message could in earlier versions - sometimes be the process identifier of the monitored process and sometimes - be the registered name. Now element Object is - always a tuple consisting of the registered name and - the node name. Processes on new nodes (ERTS 5.2 - or higher versions) always get 'DOWN' messages on - the new format even if they are monitoring processes on old - nodes. Processes on old nodes always get 'DOWN' - messages on the old format.

-
- Monitoring a process @@ -3384,7 +3365,19 @@ RealSystem = system + MissedSystem process identified by Item, which can be a pid() (local or remote), an atom RegisteredName or a tuple {RegisteredName, Node} for a registered process, - located elsewhere.

+ located elsewhere.

+ +

Before ERTS 10.0 (OTP 21.0), monitoring a process could fail with + badarg if the monitored process resided on a primitive node + (such as erl_interface or jinterface), where remote process monitoring + is not implemented.

+

Now, such a call to monitor will instead succeed and a + monitor is created. But the monitor will only supervise the + connection. That is, a {'DOWN', _, process, _, noconnection} is + the only message that may be received, as the primitive node have no + way of reporting the status of the monitored process.

+
+
Monitoring a port -- cgit v1.2.3