EOFException with async client of nioEventLoop


#1

Using aerospike Java client 4.0.6

aerospike server 3.14.1.2

Repeatedly getting following exception :

com.aerospike.client.AerospikeException: java.io.EOFException at com.aerospike.client.async.NioEventLoop.processKey(NioEventLoop.java:276) at com.aerospike.client.async.NioEventLoop.runCommands(NioEventLoop.java:206) at com.aerospike.client.async.NioEventLoop.run(NioEventLoop.java:165) Caused by: java.io.EOFException at com.aerospike.client.async.NioConnection.read(NioConnection.java:112) at com.aerospike.client.async.NioCommand.read(NioCommand.java:240) at com.aerospike.client.async.NioEventLoop.processKey(NioEventLoop.java:254) … 2 more Even if I am following the steps mentioned in aerospike website for async client http://www.aerospike.com/docs/client/java/usage/async

On debugging deep I found it is from class :com.aerospike.client.async.NioConnection

method :

public boolean read(ByteBuffer byteBuffer) throws IOException {
    while (byteBuffer.hasRemaining()) {
        int len = socketChannel.read(byteBuffer);

        if (len == 0) {         
            // Got would-block.
            return false;
        }

        if (len < 0) {
            // Server has shutdown socket.
            throw new EOFException();
        }
    }`
    return true;
}

But not getting any configuration to fix it.


#2

discusses this issue to some extent.


#3

How to tell server not to close connection or if connection is closed the open it. Application waits for about 3 mins before giving exception.


#4

Not my area of expertise … based on what I have read, you should set application side timeout to 55 seconds.

https://www.aerospike.com/apidocs/java/com/aerospike/client/policy/ClientPolicy.html#maxSocketIdle

Server timeout to close socket on no activity is set at 60 seconds. Don’t increase this or you may run out of file handles.

http://www.aerospike.com/docs/reference/configuration#proto-fd-idle-ms

Are you using Enterprise Edition? If so, use your 24/7 included support and open a support ticket.