Skip to content

Unable to reconnect with server after 2.4.1 update #73

@gjhommersom

Description

@gjhommersom

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.

    public @NotNull CompletableFuture<Connection> connectAsync() {
    if (socket != null) {
    throw new ReqlDriverError("Client already connected!");
    }

  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.

    protected @NotNull CompletableFuture<Response> sendQuery(@NotNull Query query) {
    if (socket == null || !socket.isOpen()) {
    throw new ReqlDriverError("Client not connected.");
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions