jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1694819 - in /jmeter/trunk: src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java xdocs/changes.xml
Date Sat, 08 Aug 2015 16:50:55 GMT
Author: sebb
Date: Sat Aug  8 16:50:54 2015
New Revision: 1694819

URL: http://svn.apache.org/r1694819
Log:
JMeter hang when testing javasampler because HashMap.put() is called from multiple threads
without sync.
Bugzilla Id: 58209

Modified:
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java?rev=1694819&r1=1694818&r2=1694819&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java
(original)
+++ jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java
Sat Aug  8 16:50:54 2015
@@ -20,8 +20,10 @@ package org.apache.jmeter.protocol.java.
 
 import java.lang.reflect.Method;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.jmeter.config.Arguments;
 import org.apache.jmeter.config.ConfigTestElement;
@@ -55,7 +57,8 @@ public class JavaSampler extends Abstrac
      * Set used to register instances which implement tearDownTest.
      * This is used so that the JavaSamplerClient can be notified when the test ends.
      */
-    private static final Set<JavaSampler> TEAR_DOWN_SET = new HashSet<JavaSampler>();
+    private static final Set<JavaSampler> TEAR_DOWN_SET = 
+            Collections.newSetFromMap(new ConcurrentHashMap<JavaSampler,Boolean>());
 
     /**
      * Property key representing the classname of the JavaSamplerClient to user.

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1694819&r1=1694818&r2=1694819&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sat Aug  8 16:50:54 2015
@@ -146,6 +146,7 @@ Summary
 <h3>Other Samplers</h3>
 <ul>
     <li><bug>58013</bug>Enable all protocols that are enabled on the default
SSLContext for usage with the SMTP Sampler.</li>
+    <li><bug>58209</bug>JMeter hang when testing javasampler because HashMap.put()
is called from multiple threads without sync.</li>
 </ul>
 
 <h3>Controllers</h3>



Mime
View raw message