-
Notifications
You must be signed in to change notification settings - Fork 17
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
Timeout causes error #547
Comments
@Jad-el-khoury have you encountered something similar? |
Does not look familiar to me, no. |
@dhakehurst I am guess some (not completely correct) client instance reuse is happening. Did you manage to track down the origin of the defect? We will be glad to merge your fix. Apologies for not noticing your report earlier. |
@Jad-el-khoury @dhakehurst I just checked and indeed we were using the builder incorrectly - we created a single instance of a client and persisted it. We should instead create a new client for every request. I think I was wary of the resource overhead and introduced this defect in a premature optimisation attempt. Here are the proposed changes:
I don't have much time to make the PR and do testing (esp. around OAuth and cookie reuse) - happy to accept a PR. |
I checked again and https://jakartaee.github.io/rest/apidocs/3.0.0/jakarta/ws/rs/client/Client.html does not recommend instantiating many Will need a more in-depth look. |
OSLC/lyo-samples#170 - verified on a real Jazz server to work fine https://github.com/OSLC/lyo-samples/actions/runs/11806371590/job/32890826618 Please observe that https://hc.apache.org/httpcomponents-client-5.4.x/current/httpclient5/apidocs/org/apache/hc/client5/http/config/RequestConfig.Builder.html#setConnectTimeout-org.apache.hc.core5.util.Timeout- is deprecated and the socket timeout was removed altogether from newer versions of the Apache client. Because we are using JAX-RS client facilities, we should be using their way of setting timeouts: https://jakartaee.github.io/rest/apidocs/3.0.0/jakarta/ws/rs/client/ClientBuilder.html#connectTimeout(long,java.util.concurrent.TimeUnit) Please reopen the issue if you can still reproduce an error. |
I'm using version 5.1.1.Final
I find that if I set 'timeouts' the second of the requests in the following code fails.
I cannot see why ?
With no timeout (which defaults to -1) it works fine,
except on the occasion that the server does not respond - hence I want to use a timeout.
However, adding the timeout(s), of any value, causes a socket read-timeout on the second request ('query.submit')
The text was updated successfully, but these errors were encountered: