Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-1126

A single Host spawns many reconnect tasks

    XMLWordPrintableJSON

    Details

      Description

      While attempting to recover a connection to a gremlin server that has gone offline, the Host object spawns many reconnect tasks

      The following code in Host.makeUnavailable() will always create and schedule a new Runnable no matter the value of reconnectionAttempt

              reconnectionAttempt.compareAndSet(null,
                      this.cluster.executor().scheduleAtFixedRate(() -> {
                                  logger.debug("Trying to reconnect to dead host at {}", this);
                                  if (reconnect.apply(this)) reconnected();
                              }, cluster.connectionPoolSettings().reconnectInitialDelay,
                              cluster.connectionPoolSettings().reconnectInterval, TimeUnit.MILLISECONDS));
      

      It is just that the ScheduledFuture returned by scheduleAtFixedRate will be ignored if reconnectionAttempt != null.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                spmallette Stephen Mallette
                Reporter:
                kieransherlock Kieran Sherlock
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: