GitHub user leons727 opened a pull request:
https://github.com/apache/curator/pull/46
Performance fix in processChildren()
Current implementation may lead to a large number of calls to
java.util.ArrayList.contains() with a large list, when syncing a large number
of path children, as evident from this stack trace:
```
"main-EventThread" daemon prio=10 tid=0x00007fd089593800 nid=0x6fbf
runnable [0x00007fd0eb3a1000]
java.lang.Thread.State: RUNNABLE
at java.util.ArrayList.indexOf(ArrayList.java:298)
at java.util.ArrayList.contains(ArrayList.java:281)
at java.util.AbstractSet.removeAll(AbstractSet.java:176)
at
org.apache.curator.framework.recipes.cache.PathChildrenCache.processChildren(PathChildrenCache.java:655)
at
org.apache.curator.framework.recipes.cache.PathChildrenCache.access$200(PathChildrenCache.java:68)
at
org.apache.curator.framework.recipes.cache.PathChildrenCache$4.processResult(PathChildrenCache.java:490)
at
org.apache.curator.framework.imps.CuratorFrameworkImpl.sendToBackgroundCallback(CuratorFrameworkImpl.java:715)
at
org.apache.curator.framework.imps.CuratorFrameworkImpl.processBackgroundOperation(CuratorFrameworkImpl.java:502)
at
org.apache.curator.framework.imps.GetChildrenBuilderImpl$2.processResult(GetChildrenBuilderImpl.java:166)
at
org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:587)
at
org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:495)
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/leons727/curator master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/curator/pull/46.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #46
----
commit bea6b80ec2622251156143b45c49a7f7871082cd
Author: Leon Stein <[email protected]>
Date: 2014-10-03T21:09:27Z
Performance fix in processChildren()
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---