[erlang-questions] C-Node breakage with git master

Andreas Schultz aschultz@REDACTED
Tue Nov 21 16:23:36 CET 2017


Hi,

Something in the C-node handling changed between otp-20.1.3 and
today git master branch.

I have a C-node that implements the remote end of net_adm:ping/1.
To do that, it needs to answer to 

  gen:call({net_kernel, Node}, '$gen_call', {is_auth, node()}, infinity)

Code is at [1].

In 20.1.3, the call is send as a plain message. With today's git master
it first attempts to setup a monitor (a ERL_MONITOR_P message is sent).

Monitors are not supported by C-node and ei_xreceive_msg therefor returns
an error, causing a connection abort.

Reading through some the distribution code and gen.erl code, it seems
that the C-node support is somewhat broken to begin with. There is
a comment in gen.erl [2] that suggests that a attempting to setup a
monitor on a C-node should return with an error. However, this would
need to be done on sending side. ei_xreceive_msg has no support to
deal with it and the error code would not allow the consumer to
implement proper handling.

There are two flags in the distribution protocol (DFLAG_DIST_MONITOR and
DFLAG_DIST_MONITOR_NAME). C-Nodes do set the DFLAG_DIST_MONITOR, but not
the DFLAG_DIST_MONITOR_NAME flag. This seems to be wrong, IMHO the 
DFLAG_DIST_MONITOR should be cleared.

But, I also can't find the place where erlang:monitor/1 would actually
check and honor those flags. The monitor BIF seems to always send a
monitor request regardless of the node flags.

So my questions are:

1. Has anyone an idea what changed to cause the ping/is_auth change?
2. What is the correct way to implement a gen_server in a C-Node or
   is it in deed currently not possible/broken?

Regards
Andreas

[1]: https://github.com/travelping/capwap-dp/blob/master/src/capwap-dp.c#L943
[2]: https://github.com/erlang/otp/blob/master/lib/stdlib/src/gen.erl#L184
--
Dipl.-Inform. Andreas Schultz

email: as@REDACTED
phone: +49-391-819099-224

----------------------- enabling your networks ----------------------

Travelping GmbH                     phone:  +49-391-81 90 99 0
Roentgenstr.  13                    fax:    +49-391-81 90 99 299
39108 Magdeburg                     email:  info@REDACTED
GERMANY                             web:    http://www.travelping.com

Company Registration: Amtsgericht Stendal        Reg No.:   HRB 10578
Geschaeftsfuehrer: Holger Winkelmann          VAT ID No.: DE236673780
---------------------------------------------------------------------



More information about the erlang-questions mailing list