curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CURATOR-126) IllegalStateException in performBackgroundOperation during close
Date Mon, 28 Jul 2014 20:59:39 GMT


ASF GitHub Bot commented on CURATOR-126:

Github user dragonsinth commented on a diff in the pull request:
    --- Diff: curator-framework/src/main/java/org/apache/curator/framework/imps/
    @@ -74,7 +71,7 @@
         private final NamespaceFacadeCache namespaceFacadeCache;
         private final NamespaceWatcherMap namespaceWatcherMap = new NamespaceWatcherMap(this);
    -    private volatile ExecutorService executorService;
    +    private volatile Thread backgroundThread;
    --- End diff --
    Fair point, I'll revert.
    BTW: I tried tracing back through the code and was not able to locate the code path from
ExecutorService.shutdownNow() -> FutureTask.cancel() under 1.6.  So I might actually be
confused and thinking of a Guava executor and not a JDK one, it's possible the JDK shutdownNow()
is actually safe.  If so, apologizes for the mis-info.
    Either way, CloseableExecutorService.close() probably does have the issue since it does
an explicit cancel(true).

> IllegalStateException in performBackgroundOperation during close
> ----------------------------------------------------------------
>                 Key: CURATOR-126
>                 URL:
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 2.5.0
>            Reporter: Scott Blum
>            Assignee: Cameron McKenzie
>   Original Estimate: 24h
>  Remaining Estimate: 24h
> {code}
> [CuratorFramework-0] ERROR org.apache.curator.framework.imps.CuratorFrameworkImpl  -
Background exception was not retry-able or retry gave up
> java.lang.IllegalStateException: Client is not started
> 	at
> 	at org.apache.curator.CuratorZookeeperClient.getZooKeeper(
> 	at org.apache.curator.framework.imps.CuratorFrameworkImpl.performBackgroundOperation(
> 	at org.apache.curator.framework.imps.CuratorFrameworkImpl.backgroundOperationsLoop(
> 	at org.apache.curator.framework.imps.CuratorFrameworkImpl.access$400(
> 	at org.apache.curator.framework.imps.CuratorFrameworkImpl$
> 	at
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(
> 	at java.util.concurrent.ThreadPoolExecutor$
> 	at
> {code}
> I see this sometimes during test runs; I believe this happens because CuratorZookeeperClient.started
gets set to false during shutdown, but the backgroundOperation loop can still be running since
shutting down the backgroundOperation loop is inherently racy.

This message was sent by Atlassian JIRA

View raw message