Re: Question about connecting to a node and proposed patch

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

Bill Clementson <[email protected]> writes:

> One of the things that tends to bug me a bit is that, when I connect
> to a node for the first time, the distel modules aren't loaded into
> that node until you actually attempt to communicate with the node
> (e.g. - display processes with "C-c C-d l" or reload a module with
> "C-c C-d L"). At that point, the distel modules are loaded into the
> node and you get a message stating "(Successfully uploaded backend
> modules into node)". However, the action that you attempted (e.g. - if
> you pressed "C-c C-d l" to display processes) is not actually executed
> because the distel modules hadn't been previously loaded. Obviously,
> this issue has bugged a number of other people in the past too as
> there are a couple of similar messages on the mailing list and an
> enhancement request on the google code distel web site
> (http://code.google.com/p/distel/issues/list).

I do not experience this problem - C-c C-d C-l and others work first
time round for me, every time.

Do you have distel in your erlang load path, e.g. did you add it to
~/.erlang? I do, but there is a recent enhancement where that supposedly
is no longer necessary. Perhaps you are using that new feature. However,
it doesn't work for me at all - I just get a "badrpc" error all the
time - so I have continued using the established way.

> Is there some reason why the uploading of distel modules to a node
> shouldn't occur when you first connect to a node?

That is what is supposed to happen, and it works for me.

> I couldn't think of any good reasons not to, so I've made a patch to
> erl-choose-nodename.

erl-choose-nodename is not meant to connect to the node, so this is the
wrong place to fix this problem.

Looking at the code, I believe the distel module loading happens via the
following hook:
   (add-hook 'erl-nodeup-hook 'erl-check-backend)
I wonder whether there is a race condition which results in this hook
being invoked too late when you first connect.


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/