Open gjhommersom opened 9 months ago
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.
Connection.reconnect()
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. https://github.com/rethinkdb/rethinkdb-java/blob/efd7c0aa5ac23a436870daae814174a83af83304/src/main/java/com/rethinkdb/net/Connection.java#L125-L128
socket
connectAsync
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. https://github.com/rethinkdb/rethinkdb-java/blob/efd7c0aa5ac23a436870daae814174a83af83304/src/main/java/com/rethinkdb/net/Connection.java#L447-L450
reconnect
false
true
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
socket
field is never set to null so theconnectAsync
call will always fail. https://github.com/rethinkdb/rethinkdb-java/blob/efd7c0aa5ac23a436870daae814174a83af83304/src/main/java/com/rethinkdb/net/Connection.java#L125-L128The
reconnect
method must be given a value offalse
. If a value oftrue
is used a query is attempted that will fail because it has no active connection. https://github.com/rethinkdb/rethinkdb-java/blob/efd7c0aa5ac23a436870daae814174a83af83304/src/main/java/com/rethinkdb/net/Connection.java#L447-L450