Connection timeout with HTTP protocol

8 views
Skip to first unread message

Tze-John Tang

unread,
Mar 17, 2015, 3:10:51 PM3/17/15
to sta...@clarkparsia.com
I am using the HTTP protocol for connection to the triple store, using a connection pool. After a series of constant queries, for may 5 or 6 minutes, a request to the triple store will just hang, resulting in a Connection Timeout. I reduced the pool size down to a max size of 1, to try to troubleshoot the issue. What I see is that before the hang, some connection attempts to the triple store will take a little longer to complete. It will hang for a few seconds then continue, until the one that hits whatever the max timeout is set to.

My trace looks as below.  I have not come up with a test case where I am only using the Stardog classes, that will be my next step.  But I just wanted to post to see if anyone else was seeing these issues.

abbvie.gprd.rdf.service.RdfException: Error querying for RDF type.
at abbvie.gprd.rdf.service.rdf.ResourceUtil.getResourceTypeStatement(ResourceUtil.java:61)
at abbvie.gprd.rdf.service.rdf.ResourceUtil.getResourceType(ResourceUtil.java:102)
at abbvie.gprd.rdf.service.rdf.LoadTest.executeRecursiveFetch(LoadTest.java:78)
at abbvie.gprd.rdf.service.rdf.LoadTest.executeRecursiveFetch(LoadTest.java:81)
at abbvie.gprd.rdf.service.rdf.LoadTest.executeRecursiveFetch(LoadTest.java:81)
at abbvie.gprd.rdf.service.rdf.LoadTest.executeRecursiveFetch(LoadTest.java:81)
at abbvie.gprd.rdf.service.rdf.LoadTest.executeRecursiveFetch(LoadTest.java:81)
at abbvie.gprd.rdf.service.rdf.LoadTest.executeRecursiveFetch(LoadTest.java:81)
at abbvie.gprd.rdf.service.rdf.LoadTest.doLoadTest(LoadTest.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: com.complexible.stardog.StardogException: Connection timed out: connect
at com.complexible.stardog.protocols.client.SPECClientUtil.toStardogException(SPECClientUtil.java:80)
at com.complexible.stardog.protocols.client.SPECClientUtil.toStardogException(SPECClientUtil.java:32)
at com.complexible.stardog.api.impl.SPECSelectQuery.execute(SPECSelectQuery.java:60)
at com.complexible.stardog.api.impl.SPECSelectQuery.execute(SPECSelectQuery.java:32)
at com.complexible.stardog.api.impl.GetterImpl.execute(GetterImpl.java:220)
at com.complexible.stardog.api.impl.GetterImpl.iterator(GetterImpl.java:180)
at com.complexible.stardog.api.impl.GetterImpl.statement(GetterImpl.java:128)
at abbvie.gprd.rdf.service.rdf.ResourceUtil.getResourceTypeStatement(ResourceUtil.java:58)
... 32 more
Caused by: com.complexible.common.protocols.client.ClientException: Connection timed out: connect
at com.complexible.stardog.protocols.http.client.BaseHttpClient.execute(BaseHttpClient.java:246)
at com.complexible.stardog.protocols.http.client.HttpClientImpl.select(HttpClientImpl.java:300)
at com.complexible.stardog.protocols.http.client.HttpClientImpl.select(HttpClientImpl.java:92)
at com.complexible.stardog.api.impl.SPECSelectQuery.execute(SPECSelectQuery.java:53)
... 37 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:117)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:178)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at com.complexible.stardog.protocols.http.client.BaseHttpClient.executeRaw(BaseHttpClient.java:256)
at com.complexible.stardog.protocols.http.client.BaseHttpClient.execute(BaseHttpClient.java:241)
... 40 more


-tj

Tze-John Tang

unread,
Mar 17, 2015, 3:55:13 PM3/17/15
to sta...@clarkparsia.com
I was able to duplicate it with an example only using Stardog API. I am going to attempt on run of this on the server itself, to see if it is a networking issue or not.

-tj
StardogOnlyLoadTest.java

Tze-John Tang

unread,
Mar 17, 2015, 10:24:50 PM3/17/15
to sta...@clarkparsia.com
This seems to be a networking issue.  Does anyone know what the timeout values are?

-tj

Tze-John Tang

unread,
Mar 18, 2015, 8:54:19 AM3/18/15
to sta...@clarkparsia.com
Is the HTTPClient connection set to auto retry on a connection timeout? If not, is there anyway for me to configure it so that it will retry? The network issues may take longer to troubleshoot.

Thanks,

-tj

Michael Grove

unread,
Mar 19, 2015, 9:53:12 AM3/19/15
to stardog
On Wed, Mar 18, 2015 at 8:54 AM, Tze-John Tang <tzejoh...@gmail.com> wrote:
Is the HTTPClient connection set to auto retry on a connection timeout? If not, is there anyway for me to configure it so that it will retry? The network issues may take longer to troubleshoot.

No, we don't expose any of those knobs when we create the HttpClient instance internally.

Cheers,

Mike
 

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Reply all
Reply to author
Forward
0 new messages