rethinkdb-java icon indicating copy to clipboard operation
rethinkdb-java copied to clipboard

Unable to reconnect with server after 2.4.1 update

Open gjhommersom opened this issue 2 years ago • 0 comments

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:

  1. 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

  2. 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

gjhommersom avatar Nov 21 '23 08:11 gjhommersom