Describe the bug
As of version 2.4.1 (and up to 2.4.4 of time of writing) the Connection.reconnect() method no longer works.
To Reproduce
Simplified version of our code:
while(true){
if (!connection.isOpen()){
connection.reconnect(false);
}
Expected behavior
There are 2 bugs in the code:
-
the connect method fails because the socket field is never set to null so the connectAsync call will always fail.
|
public @NotNull CompletableFuture<Connection> connectAsync() { |
|
if (socket != null) { |
|
throw new ReqlDriverError("Client already connected!"); |
|
} |
-
The reconnect method must be given a value of false. If a value of true is used a query is attempted that will fail because it has no active connection.
|
protected @NotNull CompletableFuture<Response> sendQuery(@NotNull Query query) { |
|
if (socket == null || !socket.isOpen()) { |
|
throw new ReqlDriverError("Client not connected."); |
|
} |
Describe the bug
As of version 2.4.1 (and up to 2.4.4 of time of writing) the
Connection.reconnect()method no longer works.To Reproduce
Simplified version of our code:
Expected behavior
There are 2 bugs in the code:
the connect method fails because the
socketfield is never set to null so theconnectAsynccall will always fail.rethinkdb-java/src/main/java/com/rethinkdb/net/Connection.java
Lines 125 to 128 in efd7c0a
The
reconnectmethod must be given a value offalse. If a value oftrueis used a query is attempted that will fail because it has no active connection.rethinkdb-java/src/main/java/com/rethinkdb/net/Connection.java
Lines 447 to 450 in efd7c0a