Hi Hélia, 

First, it isn't obvious to me why server A3 blocks. You need to check the
parameters of your client HTTP connector to check whether it limits the
number of concurrent requests. 

My next suggestion is to upgrade to the latest 1.0.10 version as many bugs
were fixed since 1.0.1.

Now, if this doesn't work, you could start a new thread in your handlePut()
method to let the current thread return silently. Of course, you can't
properly handle errors this way. 

Best regards,
Jerome


-----Message d'origine-----
De : Hélia Pouyllau [mailto:[EMAIL PROTECTED] 
Envoyé : lundi 2 juin 2008 17:33
À : [email protected]
Objet : Recursive put

Hi all,

I'm using the version 1.01 of Restlet and I have a kind of distributed 
deadlock problem. Let me explain it in pseudo-code:

I have a server  A http://A:8181 that contains a resource
public class AResource {
 public void handlePut() {
  Request req = new Request (Method.PUT, "http://A:8282/aresource";);
  ...
  client.handle(req);
 }
}

Then a server A2 http://A:8282 that contains a resource
public class AResource {
 public void handlePut() {
  Request req = new Request (Method.PUT, "http://A:8383/aresource";);
  ...
  client.handle(req);
 }
}

and of course a server A3 http://A:8383 that contains a resource
public class AResource {
 public void handlePut() {
  Request req = new Request (Method.PUT, "http://A:8181/aresource";);
  ...
  client.handle(req);
 }
}

A client make a put -through a web page - on server A1. The recursive 
calls should terminate - the number of  loops is counted until a bound 
is reached. But when server A3 executes its handlePut() method, it is 
blocked. I guess the handlePut() method of A1 is still waiting the 
answer from A2.  Is there a way to not wait for the answer ?

Any suggestion to bypass this problem is welcomed and sorry if it's a 
trivial question,

thanks in advance,
hp

Reply via email to