what causes com.aerospike.client.AerospikeException: java.io.EOFException? [closed]

允我心安 提交于 2019-12-12 11:44:09

问题


What is the cause of this?

com.aerospike.client.AerospikeException: java.io.EOFException
    at com.aerospike.client.async.SelectorManager.processKey(SelectorManager.java:184) [aerospike-client-3.0.24.jar:?]
    at com.aerospike.client.async.SelectorManager.runCommands(SelectorManager.java:108) [aerospike-client-3.0.24.jar:?]
    at com.aerospike.client.async.SelectorManager.run(SelectorManager.java:69) [aerospike-client-3.0.24.jar:?]
Caused by: java.io.EOFException
    at com.aerospike.client.async.AsyncConnection.read(AsyncConnection.java:127) ~[aerospike-client-3.0.24.jar:?]
    at com.aerospike.client.async.AsyncSingleCommand.read(AsyncSingleCommand.java:48) ~[aerospike-client-3.0.24.jar:?]
    at com.aerospike.client.async.SelectorManager.processKey(SelectorManager.java:164) ~[aerospike-client-3.0.24.jar:?]
    ... 2 more

回答1:


EOFException is thrown when the socket connection is no longer valid. It usually happens because the server has closed the connection.

 /**
 * Read till byteBuffer limit reached or received would-block.
 */
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;
}


来源:https://stackoverflow.com/questions/26184336/what-causes-com-aerospike-client-aerospikeexception-java-io-eofexception

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!