是什么导致com.aerospike.client.AerospikeException:java.io.EOFException?

and*_*bd1 4 java aerospike

这是什么原因?

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
Run Code Online (Sandbox Code Playgroud)

kpo*_*ter 5

当套接字连接不再有效时,抛出EOFException.这通常是因为服务器已关闭连接.

 /**
 * 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;
}
Run Code Online (Sandbox Code Playgroud)

  • 关于闭合连接EOFException的更多细节可以在以下Aerospike讨论主题中找到 - https://discuss.aerospike.com/t/what-c​​auses-aerospikeexception-java-io-eofexception/444/12 (2认同)