You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "stephen mallette (JIRA)" <ji...@apache.org> on 2016/02/13 00:19:18 UTC

[jira] [Closed] (TINKERPOP-1126) A single Host spawns many reconnect tasks

     [ https://issues.apache.org/jira/browse/TINKERPOP-1126?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stephen mallette closed TINKERPOP-1126.
---------------------------------------
    Resolution: Fixed

> A single Host spawns many reconnect tasks
> -----------------------------------------
>
>                 Key: TINKERPOP-1126
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1126
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: driver
>    Affects Versions: 3.1.0-incubating
>            Reporter: Kieran Sherlock
>            Assignee: stephen mallette
>             Fix For: 3.1.2-incubating
>
>
> 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 
> {code}
>         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));
> {code}
> It is just that the ScheduledFuture returned by scheduleAtFixedRate will be ignored if reconnectionAttempt != null.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)