[CURATOR-467] Avoid logging errors after curator framework is closed.
- Dominant language
- Java
- Stars
- 3.2k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
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.
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)
---
Originally reported by kturner, imported from: Avoid logging errors after curator framework is closed.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.