Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to reconnect with server after 2.4.1 update #73

Open
gjhommersom opened this issue Nov 21, 2023 · 0 comments
Open

Unable to reconnect with server after 2.4.1 update #73

gjhommersom opened this issue Nov 21, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@gjhommersom
Copy link

gjhommersom commented Nov 21, 2023

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.");
    }

@gjhommersom gjhommersom added the bug Something isn't working label Nov 21, 2023
@gjhommersom gjhommersom changed the title Unable to reconnect with server after 2.4.1update Unable to reconnect with server after 2.4.1 update Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant