API Timeout jdutra  2013-02-19 12:46
Status: Closed
 
I need to delete all the records from a list using the java API. Right now there are 221 records. If I manually go into labkey, show all the records, and delete them all, it works and takes more than 2 minutes (seems like a long time).

When I try to do the same thing using the java API, I get a timeout error after 1 minute. The timeouts on our server are longer than that - it appears to be a client-side timeout. I checked the timeouts in the HttpConnection - both the connection timeout and the socket timeout are 0, which should be infinite. Do you have any idea what is timing out or how I can fix it? The error is below:

java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at sun.security.ssl.InputRecord.readFully(Unknown Source)
    at sun.security.ssl.InputRecord.read(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
    at sun.security.ssl.AppInputStream.read(Unknown Source)
    at java.io.BufferedInputStream.fill(Unknown Source)
    at java.io.BufferedInputStream.read(Unknown Source)
    at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
    at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
    at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
    at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
    at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
    at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
    at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
    at org.labkey.remoteapi.Connection.executeMethod(Connection.java:271)
    at org.labkey.remoteapi.Command.execute(Command.java:217)
    at edu.rochester.urmc.cbim.immkey.util.JenUtils.PropScreen.deleteListRows(PropScreen.java:62)
    at edu.rochester.urmc.cbim.immkey.util.JenUtils.PropScreen.processFile(PropScreen.java:158)
    at edu.rochester.urmc.cbim.immkey.util.JenUtils.PropXUploader.main(PropXUploader.java:254)

Thanks,
Jen
 
 
jeckels responded:  2013-02-19 14:58
Hi Jen,

The Java client API defaults to a 60 second timeout. Have you explicitly set another timeout (like 0) on the Command object using setTimeout()? The argument is in milliseconds.

Thanks,
Josh
 
jdutra responded:  2013-02-20 09:09
Thanks for the quick response Josh. That fixes it. I don't know how I missed the setTimeout() option.
 
jdutra responded:  2013-02-20 10:25
Sorry, I realized I have one other question. Is that timeout setting exposed somewhere in the SAS or R API? If so, how can we change it there?

Thanks again,
Jen
 
cnathe responded:  2013-02-21 12:35
Jen,
I'm not sure about the SAS API, but there isn't a direct timeout that our R API supports at this time.
-Cory