-
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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
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
public @NotNull CompletableFuture<Connection> connectAsync() { if (socket != null) { throw new ReqlDriverError("Client already connected!"); } -
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
protected @NotNull CompletableFuture<Response> sendQuery(@NotNull Query query) { if (socket == null || !socket.isOpen()) { throw new ReqlDriverError("Client not connected."); }
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working