SNARL Connection Pool and NIO Channel closed

0 views
Skip to first unread message

Tze-John Tang

unread,
Apr 29, 2015, 7:46:07 AM4/29/15
to sta...@clarkparsia.com


I am using a connection pool to obtain connections to the Stardog store (Stardog 3.0).  Occasionally, I will get a connection from the pool, but when I attempt to execute a query, I will get the exception below, informing me that the channel is closed.  The isOpen() method on the connection still returns true.  Now this connection is stuck in the pool, and I will get it back the next time again when I pull a connection from the pool.

Has anyone else seen this issue before?  Is there any way for me to remove this bad connection from the pool?


com.complexible.stardog.StardogException: java.nio.channels.ClosedChannelException 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:52) at com.complexible.stardog.api.impl.SPECSelectQuery.execute(SPECSelectQuery.java:31) at com.complexible.stardog.api.impl.GetterImpl.execute(GetterImpl.java:232) at com.complexible.stardog.api.impl.GetterImpl.iterator(GetterImpl.java:192) at com.complexible.stardog.api.impl.GetterImpl.statement(GetterImpl.java:128) at abbvie.gprd.rdf.service.rdf.ResourceUtil.getResourceTypeStatement(ResourceUtil.java:64) ... 35 more Caused by: com.complexible.common.protocols.client.ClientException: java.nio.channels.ClosedChannelException at com.complexible.common.protocols.client.rpc.DefaultRPCClient.get(DefaultRPCClient.java:359) at com.complexible.common.protocols.client.rpc.DefaultRPCClient.execute(DefaultRPCClient.java:321) at com.complexible.stardog.protocols.snarl.client.SNARLClientImpl.select(SNARLClientImpl.java:167) at com.complexible.stardog.protocols.snarl.client.SNARLClientImpl.select(SNARLClientImpl.java:70) at com.complexible.stardog.api.impl.SPECSelectQuery.execute(SPECSelectQuery.java:45) ... 40 more Caused by: java.nio.channels.ClosedChannelException


Thanks,

-tj

Michael Grove

unread,
Apr 29, 2015, 8:03:07 AM4/29/15
to stardog
On Wed, Apr 29, 2015 at 7:46 AM, Tze-John Tang <tzejoh...@gmail.com> wrote:


I am using a connection pool to obtain connections to the Stardog store (Stardog 3.0).  Occasionally, I will get a connection from the pool, but when I attempt to execute a query, I will get the exception below, informing me that the channel is closed.  The isOpen() method on the connection still returns true.  Now this connection is stuck in the pool, and I will get it back the next time again when I pull a connection from the pool.

Connections are validated before being returned from the pool, but that's done via isOpen, so that explains how it gets past the validation.

That trace, combined with the fact that the connection still thinks it's open, would suggest that the server closed the connection.  Are there errors in the logs to indicate any issues on the server?

Cheers,

Mike
 

Has anyone else seen this issue before?  Is there any way for me to remove this bad connection from the pool?


com.complexible.stardog.StardogException: java.nio.channels.ClosedChannelException 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:52) at com.complexible.stardog.api.impl.SPECSelectQuery.execute(SPECSelectQuery.java:31) at com.complexible.stardog.api.impl.GetterImpl.execute(GetterImpl.java:232) at com.complexible.stardog.api.impl.GetterImpl.iterator(GetterImpl.java:192) at com.complexible.stardog.api.impl.GetterImpl.statement(GetterImpl.java:128) at abbvie.gprd.rdf.service.rdf.ResourceUtil.getResourceTypeStatement(ResourceUtil.java:64) ... 35 more Caused by: com.complexible.common.protocols.client.ClientException: java.nio.channels.ClosedChannelException at com.complexible.common.protocols.client.rpc.DefaultRPCClient.get(DefaultRPCClient.java:359) at com.complexible.common.protocols.client.rpc.DefaultRPCClient.execute(DefaultRPCClient.java:321) at com.complexible.stardog.protocols.snarl.client.SNARLClientImpl.select(SNARLClientImpl.java:167) at com.complexible.stardog.protocols.snarl.client.SNARLClientImpl.select(SNARLClientImpl.java:70) at com.complexible.stardog.api.impl.SPECSelectQuery.execute(SPECSelectQuery.java:45) ... 40 more Caused by: java.nio.channels.ClosedChannelException


Thanks,

-tj

--
-- --
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

Tze-John Tang

unread,
Apr 29, 2015, 10:08:40 AM4/29/15
to sta...@clarkparsia.com
Mike,

I see errors on the server side like:

[SEVERE com.complexible.common.protocols.server.rpc.ServerHandler.exceptionCaught - Apr 28, 2015 12:05:49.534] exceptionCaughtServerHandler
java.io.IOException: Connection reset by peer
        at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
        at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
        at sun.nio.ch.IOUtil.read(IOUtil.java:192)
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)
        at io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:447)
        at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:881)
        at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:225)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
        at java.lang.Thread.run(Thread.java:745)



-tj
Reply all
Reply to author
Forward
0 new messages