ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Beerbower" <tbeerbo...@hortonworks.com>
Subject Re: Review Request 25172: ConcurrentModificationException in Resource Comparator
Date Fri, 29 Aug 2014 10:55:38 GMT

-----------------------------------------------------------
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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message