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

Keith Turner updated CURATOR-467:
---------------------------------
    Description: 
When the following operations are performed in rapid succession, it can lead 
annoying errors being logged.

 *  Create curator framework
 * Create leader latch
 * Start leader latch
 * Close leader latch
 * Close curator framework

The errors happen because background processing queued by the leader latch is 
still in flight when the curator framework is closed.  When these background 
ops try to access the closed curator framework the following exception happens. 
 It would be nice if the messages were logged at debug after close.

{noformat}
2018-06-01 17:35:52,095 [imps.CuratorFrameworkImpl] ERROR: Background exception 
was not retry-able or retry gave up
java.lang.IllegalStateException: instance must be started before calling this 
method
        at 
org.apache.curator.shaded.com.google.common.base.Preconditions.checkState(Preconditions.java:176)
        at 
org.apache.curator.framework.imps.CuratorFrameworkImpl.delete(CuratorFrameworkImpl.java:359)
        at 
org.apache.curator.framework.recipes.leader.LeaderLatch.setNode(LeaderLatch.java:666)
        at 
org.apache.curator.framework.recipes.leader.LeaderLatch.access$300(LeaderLatch.java:64)
        at 
org.apache.curator.framework.recipes.leader.LeaderLatch$4.processResult(LeaderLatch.java:492)
        at 
org.apache.curator.framework.imps.CuratorFrameworkImpl.sendToBackgroundCallback(CuratorFrameworkImpl.java:749)
        at 
org.apache.curator.framework.imps.CuratorFrameworkImpl.processBackgroundOperation(CuratorFrameworkImpl.java:522)
        at 
org.apache.curator.framework.imps.CreateBuilderImpl.sendBackgroundResponse(CreateBuilderImpl.java:584)
        at 
org.apache.curator.framework.imps.CreateBuilderImpl.access$900(CreateBuilderImpl.java:44)
        at 
org.apache.curator.framework.imps.CreateBuilderImpl$6.processResult(CreateBuilderImpl.java:534)
        at 
org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:607)
        at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:505)
{noformat}

  was:
When the following operations are performed in rapid succession, it can lead 
annoying errors being logged.

 *  Create curator framework
 * Create leader latch
 * Start leader latch
 * Stop leader latch 
 * Close leader latch
 * Close curator framework

The errors happen because background processing queued by the leader latch is 
still in flight when the curator framework is closed.  When these background 
ops try to access the closed curator framework the following exception happens. 
 It would be nice if the messages were logged at debug after close.

{noformat}
2018-06-01 17:35:52,095 [imps.CuratorFrameworkImpl] ERROR: Background exception 
was not retry-able or retry gave up
java.lang.IllegalStateException: instance must be started before calling this 
method
        at 
org.apache.curator.shaded.com.google.common.base.Preconditions.checkState(Preconditions.java:176)
        at 
org.apache.curator.framework.imps.CuratorFrameworkImpl.delete(CuratorFrameworkImpl.java:359)
        at 
org.apache.curator.framework.recipes.leader.LeaderLatch.setNode(LeaderLatch.java:666)
        at 
org.apache.curator.framework.recipes.leader.LeaderLatch.access$300(LeaderLatch.java:64)
        at 
org.apache.curator.framework.recipes.leader.LeaderLatch$4.processResult(LeaderLatch.java:492)
        at 
org.apache.curator.framework.imps.CuratorFrameworkImpl.sendToBackgroundCallback(CuratorFrameworkImpl.java:749)
        at 
org.apache.curator.framework.imps.CuratorFrameworkImpl.processBackgroundOperation(CuratorFrameworkImpl.java:522)
        at 
org.apache.curator.framework.imps.CreateBuilderImpl.sendBackgroundResponse(CreateBuilderImpl.java:584)
        at 
org.apache.curator.framework.imps.CreateBuilderImpl.access$900(CreateBuilderImpl.java:44)
        at 
org.apache.curator.framework.imps.CreateBuilderImpl$6.processResult(CreateBuilderImpl.java:534)
        at 
org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:607)
        at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:505)
{noformat}


> Avoid logging errors after curator framework is closed.
> -------------------------------------------------------
>
>                 Key: CURATOR-467
>                 URL: https://issues.apache.org/jira/browse/CURATOR-467
>             Project: Apache Curator
>          Issue Type: Improvement
>            Reporter: Keith Turner
>            Assignee: Jordan Zimmerman
>            Priority: Major
>
> When the following operations are performed in rapid succession, it can lead 
> annoying errors being logged.
>  *  Create curator framework
>  * Create leader latch
>  * Start leader latch
>  * Close leader latch
>  * Close curator framework
> The errors happen because background processing queued by the leader latch is 
> still in flight when the curator framework is closed.  When these background 
> ops try to access the closed curator framework the following exception 
> happens.  It would be nice if the messages were logged at debug after close.
> {noformat}
> 2018-06-01 17:35:52,095 [imps.CuratorFrameworkImpl] ERROR: Background 
> exception was not retry-able or retry gave up
> java.lang.IllegalStateException: instance must be started before calling this 
> method
>       at 
> org.apache.curator.shaded.com.google.common.base.Preconditions.checkState(Preconditions.java:176)
>       at 
> org.apache.curator.framework.imps.CuratorFrameworkImpl.delete(CuratorFrameworkImpl.java:359)
>       at 
> org.apache.curator.framework.recipes.leader.LeaderLatch.setNode(LeaderLatch.java:666)
>       at 
> org.apache.curator.framework.recipes.leader.LeaderLatch.access$300(LeaderLatch.java:64)
>       at 
> org.apache.curator.framework.recipes.leader.LeaderLatch$4.processResult(LeaderLatch.java:492)
>       at 
> org.apache.curator.framework.imps.CuratorFrameworkImpl.sendToBackgroundCallback(CuratorFrameworkImpl.java:749)
>       at 
> org.apache.curator.framework.imps.CuratorFrameworkImpl.processBackgroundOperation(CuratorFrameworkImpl.java:522)
>       at 
> org.apache.curator.framework.imps.CreateBuilderImpl.sendBackgroundResponse(CreateBuilderImpl.java:584)
>       at 
> org.apache.curator.framework.imps.CreateBuilderImpl.access$900(CreateBuilderImpl.java:44)
>       at 
> org.apache.curator.framework.imps.CreateBuilderImpl$6.processResult(CreateBuilderImpl.java:534)
>       at 
> org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:607)
>       at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:505)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to