New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A client hang indefinitely if the server never reply #669
Comments
Ok, it may be related to issue #659 |
Nice, let me know if it helps! |
Good news, that fixes the problem. Here is my final client code: public static void main(String[] args) throws IOException {
Context context = new Context();
context.getParameters().add("controllerSleepTimeMs", "5000");
context.getParameters().add("maxIoIdleTimeMs", "5000");
Client client = new Client(context, Protocol.HTTP);
ClientResource cr = new ClientResource("http://localhost:8182/resttest/dummy");
cr.setNext(client);
Representation get = cr.get();
System.out.println(get.getText());
} I had to set both controllerSleepTimeMs and maxIoIdleTimeMs parameters to 5000 to get the client crash in 14 seconds. One remark is that the documentation here: http://www.restlet.org/documentation/2.1/jse/engine/org/restlet/engine/connector/BaseHelper.html says that the default value for controllerSleepTimeMs is 1 whereas it is 60000. |
Thanks for the feedback. I'll fix the doc when applying the #659 patch as the sleep time changed from the previous value documented. |
I've just fixed the documentation and applied the #659 patch. |
Great. |
Here is a small example:
Server side:
Client side:
Looking in the ConnectionController class, I found a possible explication for the issue. The selectKeys method has a sleepTime parameter which is never used.
If I use it as a parameter of the select method, it seems to fix the problem:
But this line has been modified on purpose on July to reduce CPU consumption, so I guess it is not a valid fix.
The text was updated successfully, but these errors were encountered: