ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | proactive List | May 2005 Index

<--  Date Index  --> <--  Thread Index  -->

Re: FW: [Fwd: Re: [Fwd: Re: [Fwd: [proactive] P2P question]]]



--- Begin Message ---
Hi Romain,
 So why does the program hang at the future object p1; p1 is an instance of
AO class NormalPeer, shouldn't it just return straight away like
currEntry.getDownloadResource().getID() which returns an instance of AO
class Resource and then uses its method getID()?
 At the meanwhile, I will try to change all the primitive return types in AO
class to non-primitive as mentioned in the ProActive document. However, that
didn't seem to help with this hanging problem.

Thanks,

Lee

-----Original Message-----
From: Romain Quilici [mailto:Romain.Quilici@xxxxxxxxxxxxxxx] 
Sent: Wednesday, 25 May 2005 6:33 PM
To: Lee Rong; Proactive
Subject: Re: FW: [Fwd: Re: [Fwd: Re: [Fwd: [proactive] P2P question]]]

Hello Lee,

Lee Rong wrote:

>
>
> ------------------------------------------------------------------------
>
> Subject:
> RE: FW: [Fwd: Re: [Fwd: Re: [Fwd: [proactive] P2P question]]]
> From:
> "Lee Rong" <lr98@xxxxxxxxxx>
> Date:
> Wed, 25 May 2005 16:01:55 +1000
> To:
> "'Romain Quilici'" <Romain.Quilici@xxxxxxxxxxxxxxx>, "'Proactive'" 
> <proactive@xxxxxxxxxxxxx>
>
> To:
> "'Romain Quilici'" <Romain.Quilici@xxxxxxxxxxxxxxx>, "'Proactive'" 
> <proactive@xxxxxxxxxxxxx>
>
>
>Hi Romain,
> I changed several methods in a few classes to void type in an attempt to
>solve the deadlock problem. However, now I run into a weird problem which
>freezes the AOs of NormalPeers. I traced it to almost one particular line
>and but couldn't figure out why it freezes there. In NormalPeer, from line
>890 to 893, when I try to print out the resourceID through
>currEntry.getDownloadResource().getID(), it works fine; next when I try to
>print out information about the hostPeer which holds the resource (i.e.,
>System.out.println("downloading peer is: " + p1))
>
Yes, calling  currEntry.getDownloadResource().getID() creates a future: 
p1, which is not yet available since the call is asynchronous. When you 
call  System.out.println("downloading peer is: " + p1)), you try to 
access the value, since not here the thread is blocked waiting for the 
value to be available. If never, the application hangs.

>, p1 seems to be there
>(i.e., not NULL), but when I use (System.out.println("downloading peer id
>is: " + p1.getPeerID()) 
>
p1 is never null, indeed it is a future, so the test p1 != null does not 
mean that the result is available. There is a method in ProActive  to 
test if a future that has been updated (real value available):
ProActive.isAwaited(p1), it returns false, if the result is available, 
false otherwise.
Regards

>to print out the peerID of the peer, it just freezes
>there. It does not appear to be a deadlock situation to me.
> I have attached the modified code to the email.
>
>Thanks,
>
>Lee 
>
>-----Original Message-----
>From: Romain Quilici [mailto:Romain.Quilici@xxxxxxxxxxxxxxx] 
>Sent: Tuesday, 24 May 2005 8:51 PM
>To: Lee Rong; Proactive
>Subject: Re: FW: [Fwd: Re: [Fwd: Re: [Fwd: [proactive] P2P question]]]
>
>Hi Lee,
>First about the trace I get when doing Ctrl Alt \ while the application 
>is hanging up. I don't attach the whole trace just interesting pieces:
>"main" prio=1 tid=0x0805b640 nid=0x7501 in Object.wait() 
>[bfffc000..bfffd168]
>        at java.lang.Object.wait(Native Method)
>        at 
>org.objectweb.proactive.core.body.future.FutureProxy.waitFor(FutureProxy.ja
v
>a:369)
>        - locked <0x452512c8> (a 
>org.objectweb.proactive.core.body.future.FutureProxy)
>        at 
>org.objectweb.proactive.core.body.future.FutureProxy.waitFor(FutureProxy.ja
v
>a:328)
>        - locked <0x452512c8> (a 
>org.objectweb.proactive.core.body.future.FutureProxy)
>        at 
>org.objectweb.proactive.core.body.future.FutureProxy.getRaisedException(Fut
u
>reProxy.java:245)
>        - locked <0x452512c8> (a 
>org.objectweb.proactive.core.body.future.FutureProxy)
>        at 
>org.objectweb.proactive.core.body.proxy.AbstractBodyProxy.reifyAsSynchronou
s
>(AbstractBodyProxy.java:314)
>        at 
>org.objectweb.proactive.core.body.proxy.AbstractBodyProxy.reify(AbstractBod
y
>Proxy.java:130)
>        at 
>pa.stub.pr.p_media.p2p.simulation.Stub_NormalPeer.sendResourceRequestToSupe
r
>PeerTraditional(<generated>)
>        - locked <0x45250ea0> (a 
>pa.stub.pr.p_media.p2p.simulation.Stub_NormalPeer)
>        at 
>pr.p_media.p2p.simulation.P2PSimulator.startSimulation(P2PSimulator.java:34
6
>)
>        at
pr.p_media.p2p.simulation.P2PSimulator.main(P2PSimulator.java:63)
>
>As expected the main is waiting on
sendResourceRequestToSuperPeerTraditional
>
>NormalPeer on //sea.inria.fr/Dispatcher-632083611" daemon prio=1 
>tid=0x605afc28 nid=0x784e in Object.wait() [65ba9000..65ba9cd8]
>        at java.lang.Object.wait(Native Method)
>        at 
>org.objectweb.proactive.core.body.future.FutureProxy.waitFor(FutureProxy.ja
v
>a:369)
>        - locked <0x45170c30> (a 
>org.objectweb.proactive.core.body.future.FutureProxy)
>        at 
>org.objectweb.proactive.core.body.future.FutureProxy.waitFor(FutureProxy.ja
v
>a:328)
>        - locked <0x45170c30> (a 
>org.objectweb.proactive.core.body.future.FutureProxy)
>        at 
>org.objectweb.proactive.core.body.future.FutureProxy.getRaisedException(Fut
u
>reProxy.java:245)
>        - locked <0x45170c30> (a 
>org.objectweb.proactive.core.body.future.FutureProxy)
>        at 
>org.objectweb.proactive.core.body.proxy.AbstractBodyProxy.reifyAsSynchronou
s
>(AbstractBodyProxy.java:314)
>        at 
>org.objectweb.proactive.core.body.proxy.AbstractBodyProxy.reify(AbstractBod
y
>Proxy.java:130)
>        at 
>pa.stub.pr.p_media.p2p.simulation.Stub_NormalPeer.getPeerID(<generated>)
>        at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
>        at 
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
l
>.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:324)
>        at 
>org.objectweb.proactive.core.mop.MethodCall.execute(MethodCall.java:384)
>        at 
>org.objectweb.proactive.core.body.future.FutureProxy.reify(FutureProxy.java
:
>448)
>        at 
>pa.stub.pr.p_media.p2p.simulation.Stub_NormalPeer.getPeerID(<generated>)
>        at pr.p_media.p2p.simulation.NormalPeer.start(NormalPeer.java:798)
>        at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
>        at 
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
l
>.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:324)
>        at 
>org.objectweb.proactive.core.mop.MethodCall.execute(MethodCall.java:384)
>        at 
>org.objectweb.proactive.core.body.request.RequestImpl.serveInternal(Request
I
>mpl.java:175)
>        at 
>org.objectweb.proactive.core.body.request.RequestImpl.serve(RequestImpl.jav
a
>:109)
>        at 
>org.objectweb.proactive.core.body.BodyImpl$ActiveLocalBodyStrategy.serve(Bo
d
>yImpl.java:335)
>        at 
>org.objectweb.proactive.core.body.AbstractBody.serve(AbstractBody.java:846)
>        at 
>org.objectweb.proactive.core.body.ActiveBody$FIFORunActive.runActivity(Acti
v
>eBody.java:241)
>        at 
>org.objectweb.proactive.core.body.ActiveBody.run(ActiveBody.java:145)
>        at java.lang.Thread.run(Thread.java:534)
>
>This trace shows one part of  the deadlock, it means that the NormalPeer 
>located on //sea.inria.fr/Dispatcher-632083611 is waiting for the result 
>of  NormalPeer.getPeerID call.
>In fact this peer calls getID method on an AO Peer reference, since the 
>call is synchronous, it waits until the result is back, so it waits on 
>the FutureProxy of the not yet returned value.
>In this run I got around 15 traces like this one, all stcuked on the 
>same method, so it seems very similar to cycles. This is the reasons of 
>the deadlock
>
>All other traces about Thread for AC, or NormalPeer waitng on the 
>request queue are normal (it means that their queue is empty, and that 
>they are waiting for a request to arrive)
>Hope this helps, I can send you the whole trace if you want.
>
>For your second question, all should be printed out in the main jvm, 
>even if you run a distributed simulation.
>Regards
>Lee Rong wrote:
>
>  
>
>>------------------------------------------------------------------------
>>
>>Subject:
>>RE: FW: [Fwd: Re: [Fwd: Re: [Fwd: [proactive] P2P question]]]
>>From:
>>"Lee Rong" <lr98@xxxxxxxxxx>
>>Date:
>>Tue, 24 May 2005 02:39:41 +1000
>>To:
>>"'Romain Quilici'" <Romain.Quilici@xxxxxxxxxxxxxxx>, "'Proactive'" 
>><proactive@xxxxxxxxxxxxx>
>>
>>To:
>>"'Romain Quilici'" <Romain.Quilici@xxxxxxxxxxxxxxx>, "'Proactive'" 
>><proactive@xxxxxxxxxxxxx>
>>
>>
>>Hi Romain,
>>It is OK with the tracing, I should be able to figure it out myself. Just
>>one question, when I try to run the simulation on just the local JVM, it
>>seems that the program displays messages which are not in the two JVMs
>>setting. The messages are actually some system.out.println statement in my
>>code (i.e., "The requested index in dl complete notice is: ...") and they
>>are not supposed to be displayed if the simulation runs accordingly. So
>>    
>>
>does
>  
>
>>that mean when the simulation runs in two JVMs setting, the printing
>>statements are actually printed elsewhere and not on the main JVM?
>>
>>Thanks,
>>
>>Lee
>>
>> 
>>
>>    
>>
>
>
>  
>
>------------------------------------------------------------------------
>
>
>  
>


-- 
Romain Quilici
Software Engineer
OASIS Team - INRIA Sophia-Antipolis
04 92 38 71 65
Romain.Quilici@xxxxxxxxxxxxxxx
http://www.inria.fr/oasis/Romain.Quilici/





--- End Message ---


<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.