Re: Question about connecting to a node and proposed patch

Matthias Radestock <[email protected]> Wed, 27 Jun 2007 21:25:30 +0100
Newsgroups gmane.comp.lang.erlang.distel.devel
Message-ID <[email protected]>
Bill,

Bill Clementson <[email protected]> writes:

> So, how do you work with remote nodes? Do you manually load the distel
> modules in them (or have a .erlang file or remote script set up on the
> remote machine)?

I have the distel code and a suitable .erlang file on the remote
machines.

I'd love to use the new distel code loading feature, but we have to make
it work first.

> Why would you want to use "C-c C-d n" to select a node that hasn't
> been started?

I use "C-c C-d n" for its documented purpose - to select "the nodename
to connect to in future.". So, for example, I often use the same node
for a long time and frequently restart it, and don't want to have to
think about / find out whether the node is up or down when typing "C-c
C-d n".

> If it is a race condition, loading the distel modules into the node
> when erl-choose-nodename is run will avoid this.

Sure, but it's the wrong place because it a) changes the documented (and
useful) semantics of erl-choose-nodename, b) requires that you use
erl-choose-nodename to connect to nodes rather than connection happening
as required when running some other command.

The distel code should be loaded onto the node when the connection is
initiated, which happens the first time you actually try to do something
that requires the node to be present, e.g. toggle interpretation, set
breakpoints, list processes. Also, overall the distel mode should be
quite immune to node restarts - just as it is currently when the distel
code is on the erlang load path - e.g. if I bounce a node and then
toggle interpretation I expect it to work first time, and not have to
toggle twice or use "C-c C-d n" to reselect the node.

We should figure out what is causing these problems with distel code
loading. As a stop-gap solution, may I suggest another key-bound command
"erl-ping" which executes the erl-spawn call from your patch on
(erl-target-node), i.e. it will work like most other distel commands by
prompting for a node if none is currently selected and performing the
action (in this case a call to erlang:node()) on it. Alternatively, you
could just make erl-check-backend interactive and bind it to a key.


Regards,

Matthias

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/