You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Tom Beerbower <tb...@hortonworks.com> on 2014/08/29 01:03:05 UTC
Review Request 25172: ConcurrentModificationException in Resource
Comparator
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25172/
-----------------------------------------------------------
Review request for Ambari, John Speidel and Sid Wagle.
Bugs: ambari-7067
https://issues.apache.org/jira/browse/ambari-7067
Repository: ambari
Description
-------
It looks like that when the JMX property provider times out, we just log the message and bail out of the provider. The query continues but so do the threads trying to acquire the JMX metrics. So the Comparator used at the end of the query gets a ConcurrentModificationException because another thread is still adding properties to the resource.
{code}
java.util.ConcurrentModificationException
at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1100)
at java.util.TreeMap$EntryIterator.next(TreeMap.java:1136)
at java.util.TreeMap$EntryIterator.next(TreeMap.java:1131)
at java.util.AbstractMap.toString(AbstractMap.java:485)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at java.util.AbstractMap.toString(AbstractMap.java:490)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at org.apache.ambari.server.controller.internal.ResourceImpl.toString(ResourceImpl.java:143)
at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ResourceComparator.compare(ClusterControllerImpl.java:828)
at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ResourceComparator.compare(ClusterControllerImpl.java:773)
at org.apache.ambari.server.controller.internal.ClusterControllerImplTest.testComparatorConcurrentModification(ClusterControllerImplTest.java:857)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
{code}
Diffs
-----
ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java b5a5059
ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java b4c3c6a
Diff: https://reviews.apache.org/r/25172/diff/
Testing
-------
Added new unit test. All existing tests pass.
Thanks,
Tom Beerbower
Re: Review Request 25172: ConcurrentModificationException in Resource
Comparator
Posted by Tom Beerbower <tb...@hortonworks.com>.
> On Aug. 29, 2014, 1:04 a.m., Sid Wagle wrote:
> > Ship It!
Thanks Sid!
- Tom
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25172/#review51858
-----------------------------------------------------------
On Aug. 28, 2014, 11:03 p.m., Tom Beerbower wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25172/
> -----------------------------------------------------------
>
> (Updated Aug. 28, 2014, 11:03 p.m.)
>
>
> Review request for Ambari, John Speidel and Sid Wagle.
>
>
> Bugs: ambari-7067
> https://issues.apache.org/jira/browse/ambari-7067
>
>
> Repository: ambari
>
>
> Description
> -------
>
> It looks like that when the JMX property provider times out, we just log the message and bail out of the provider. The query continues but so do the threads trying to acquire the JMX metrics. So the Comparator used at the end of the query gets a ConcurrentModificationException because another thread is still adding properties to the resource.
>
> {code}
> java.util.ConcurrentModificationException
> at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1100)
> at java.util.TreeMap$EntryIterator.next(TreeMap.java:1136)
> at java.util.TreeMap$EntryIterator.next(TreeMap.java:1131)
> at java.util.AbstractMap.toString(AbstractMap.java:485)
> at java.lang.String.valueOf(String.java:2826)
> at java.lang.StringBuilder.append(StringBuilder.java:115)
> at java.util.AbstractMap.toString(AbstractMap.java:490)
> at java.lang.String.valueOf(String.java:2826)
> at java.lang.StringBuilder.append(StringBuilder.java:115)
> at org.apache.ambari.server.controller.internal.ResourceImpl.toString(ResourceImpl.java:143)
> at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ResourceComparator.compare(ClusterControllerImpl.java:828)
> at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ResourceComparator.compare(ClusterControllerImpl.java:773)
> at org.apache.ambari.server.controller.internal.ClusterControllerImplTest.testComparatorConcurrentModification(ClusterControllerImplTest.java:857)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
> at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
> at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
> at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
> at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
>
> {code}
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java b5a5059
> ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java b4c3c6a
>
> Diff: https://reviews.apache.org/r/25172/diff/
>
>
> Testing
> -------
>
> Added new unit test. All existing tests pass.
>
>
> Thanks,
>
> Tom Beerbower
>
>
Re: Review Request 25172: ConcurrentModificationException in Resource
Comparator
Posted by Sid Wagle <sw...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25172/#review51858
-----------------------------------------------------------
Ship it!
Ship It!
- Sid Wagle
On Aug. 28, 2014, 11:03 p.m., Tom Beerbower wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25172/
> -----------------------------------------------------------
>
> (Updated Aug. 28, 2014, 11:03 p.m.)
>
>
> Review request for Ambari, John Speidel and Sid Wagle.
>
>
> Bugs: ambari-7067
> https://issues.apache.org/jira/browse/ambari-7067
>
>
> Repository: ambari
>
>
> Description
> -------
>
> It looks like that when the JMX property provider times out, we just log the message and bail out of the provider. The query continues but so do the threads trying to acquire the JMX metrics. So the Comparator used at the end of the query gets a ConcurrentModificationException because another thread is still adding properties to the resource.
>
> {code}
> java.util.ConcurrentModificationException
> at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1100)
> at java.util.TreeMap$EntryIterator.next(TreeMap.java:1136)
> at java.util.TreeMap$EntryIterator.next(TreeMap.java:1131)
> at java.util.AbstractMap.toString(AbstractMap.java:485)
> at java.lang.String.valueOf(String.java:2826)
> at java.lang.StringBuilder.append(StringBuilder.java:115)
> at java.util.AbstractMap.toString(AbstractMap.java:490)
> at java.lang.String.valueOf(String.java:2826)
> at java.lang.StringBuilder.append(StringBuilder.java:115)
> at org.apache.ambari.server.controller.internal.ResourceImpl.toString(ResourceImpl.java:143)
> at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ResourceComparator.compare(ClusterControllerImpl.java:828)
> at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ResourceComparator.compare(ClusterControllerImpl.java:773)
> at org.apache.ambari.server.controller.internal.ClusterControllerImplTest.testComparatorConcurrentModification(ClusterControllerImplTest.java:857)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
> at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
> at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
> at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
> at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
>
> {code}
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java b5a5059
> ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java b4c3c6a
>
> Diff: https://reviews.apache.org/r/25172/diff/
>
>
> Testing
> -------
>
> Added new unit test. All existing tests pass.
>
>
> Thanks,
>
> Tom Beerbower
>
>
Re: Review Request 25172: ConcurrentModificationException in Resource
Comparator
Posted by John Speidel <js...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25172/#review51883
-----------------------------------------------------------
Ship it!
Ship It!
- John Speidel
On Aug. 29, 2014, 10:55 a.m., Tom Beerbower wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25172/
> -----------------------------------------------------------
>
> (Updated Aug. 29, 2014, 10:55 a.m.)
>
>
> Review request for Ambari, John Speidel and Sid Wagle.
>
>
> Bugs: ambari-7067
> https://issues.apache.org/jira/browse/ambari-7067
>
>
> Repository: ambari
>
>
> Description
> -------
>
> It looks like that when the JMX property provider times out, we just log the message and bail out of the provider. The query continues but so do the threads trying to acquire the JMX metrics. So the Comparator used at the end of the query gets a ConcurrentModificationException because another thread is still adding properties to the resource.
>
> {code}
> java.util.ConcurrentModificationException
> at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1100)
> at java.util.TreeMap$EntryIterator.next(TreeMap.java:1136)
> at java.util.TreeMap$EntryIterator.next(TreeMap.java:1131)
> at java.util.AbstractMap.toString(AbstractMap.java:485)
> at java.lang.String.valueOf(String.java:2826)
> at java.lang.StringBuilder.append(StringBuilder.java:115)
> at java.util.AbstractMap.toString(AbstractMap.java:490)
> at java.lang.String.valueOf(String.java:2826)
> at java.lang.StringBuilder.append(StringBuilder.java:115)
> at org.apache.ambari.server.controller.internal.ResourceImpl.toString(ResourceImpl.java:143)
> at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ResourceComparator.compare(ClusterControllerImpl.java:828)
> at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ResourceComparator.compare(ClusterControllerImpl.java:773)
> at org.apache.ambari.server.controller.internal.ClusterControllerImplTest.testComparatorConcurrentModification(ClusterControllerImplTest.java:857)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
> at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
> at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
> at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
> at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
>
> {code}
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java b5a5059
> ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java b4c3c6a
>
> Diff: https://reviews.apache.org/r/25172/diff/
>
>
> Testing
> -------
>
> Added new unit test. All existing tests pass.
>
>
> Thanks,
>
> Tom Beerbower
>
>
Re: Review Request 25172: ConcurrentModificationException in Resource
Comparator
Posted by Tom Beerbower <tb...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25172/
-----------------------------------------------------------
(Updated Aug. 29, 2014, 10:55 a.m.)
Review request for Ambari, John Speidel and Sid Wagle.
Changes
-------
Update patch.
Bugs: ambari-7067
https://issues.apache.org/jira/browse/ambari-7067
Repository: ambari
Description
-------
It looks like that when the JMX property provider times out, we just log the message and bail out of the provider. The query continues but so do the threads trying to acquire the JMX metrics. So the Comparator used at the end of the query gets a ConcurrentModificationException because another thread is still adding properties to the resource.
{code}
java.util.ConcurrentModificationException
at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1100)
at java.util.TreeMap$EntryIterator.next(TreeMap.java:1136)
at java.util.TreeMap$EntryIterator.next(TreeMap.java:1131)
at java.util.AbstractMap.toString(AbstractMap.java:485)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at java.util.AbstractMap.toString(AbstractMap.java:490)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at org.apache.ambari.server.controller.internal.ResourceImpl.toString(ResourceImpl.java:143)
at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ResourceComparator.compare(ClusterControllerImpl.java:828)
at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ResourceComparator.compare(ClusterControllerImpl.java:773)
at org.apache.ambari.server.controller.internal.ClusterControllerImplTest.testComparatorConcurrentModification(ClusterControllerImplTest.java:857)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
{code}
Diffs (updated)
-----
ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java b5a5059
ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java b4c3c6a
Diff: https://reviews.apache.org/r/25172/diff/
Testing
-------
Added new unit test. All existing tests pass.
Thanks,
Tom Beerbower