Re: Question about connecting to a node and proposed patch

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

Bill Clementson <[email protected]> writes:

>> 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.
>
> Aha! This is the problem and the explanation for why you and I get
> such different behavior for the same test cases.

That's great news. At least we now know which area to investigate,
namely the new distel module loading code.

> If you try the test cases that I outlined in my previous messages with
> a remote node, you should see the same behaviour that I was seeing
> locally (before I added the path to my .erlang file).

I am not seeing the same behaviour. As I mentioned previously (see quote
at top), the new distel loading feature does not work for me at
all. That could be because I am running XEmacs.

> Therefore, there is probably still a case for doing the initial
> erl-spawn in erl-choose-nodename.

No. erl-choose-nodename is not supposed to anything other than selecting
the node name for subsequent interactions. It should not initiate any
interactions itself. So, for example, it should make no difference
whether you first start a node and then use "C-c C-d C-n" to select it
for subsequent communication, or vice versa.

>> 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.
>
> In stepping through the code, I noticed that the hook was only being
> called when the first communication occured with the node (not as a
> result of erl-choose-nodename).

That is how it is supposed to work.

The question we need to answer is *why* does executing erl-check-backend
on erl-nodeup not have the desired result? I suspect the answer may be
some race condition, e.g. distel ends up calling distel functions on the
node before the distel code has been fully loaded onto it.


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/