jakarta-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1164186 - in /jakarta/jmeter/trunk: bin/jmeter.properties src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java xdocs/changes.xml xdocs/usermanual/component_reference.xml
Date Thu, 01 Sep 2011 17:52:41 GMT
Author: sebb
Date: Thu Sep  1 17:52:41 2011
New Revision: 1164186

URL: http://svn.apache.org/viewvc?rev=1164186&view=rev
Log:
Don't automatically retry with HttpCLient4 sampler

Modified:
    jakarta/jmeter/trunk/bin/jmeter.properties
    jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
    jakarta/jmeter/trunk/xdocs/changes.xml
    jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml

Modified: jakarta/jmeter/trunk/bin/jmeter.properties
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/bin/jmeter.properties?rev=1164186&r1=1164185&r2=1164186&view=diff
==============================================================================
--- jakarta/jmeter/trunk/bin/jmeter.properties (original)
+++ jakarta/jmeter/trunk/bin/jmeter.properties Thu Sep  1 17:52:41 2011
@@ -251,7 +251,7 @@ log_level.jorphan=INFO
 # 0 now means don't retry connection (in 2.3 and before it meant no tries at all!)
 
 #---------------------------------------------------------------------------
-# HTTPClient configuration
+# Commons HTTPClient configuration
 #---------------------------------------------------------------------------
 
 # define a properties file for overriding Commons HttpClient parameters
@@ -302,7 +302,7 @@ log_level.jorphan=INFO
 #log_file.httpclient=httpclient.log
 
 
-#         Apache HttpClient logging examples
+#         Apache Commons HttpClient logging examples
 #
 # Enable header wire + context logging - Best for Debugging
 #log_level.org.apache.http=DEBUG
@@ -320,6 +320,13 @@ log_level.jorphan=INFO
 #log_level.org.apache.http.client=DEBUG
 
 #---------------------------------------------------------------------------
+# Apache HttpComponents HTTPClient configuration (HTTPClient4)
+#---------------------------------------------------------------------------
+
+# Number of retries to attempt (default 0)
+#httpclient4.retrycount=0
+
+#---------------------------------------------------------------------------
 # Results file configuration
 #---------------------------------------------------------------------------
 

Modified: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java?rev=1164186&r1=1164185&r2=1164186&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
(original)
+++ jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
Thu Sep  1 17:52:41 2011
@@ -50,6 +50,7 @@ import org.apache.http.auth.NTCredential
 import org.apache.http.auth.UsernamePasswordCredentials;
 import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.HttpClient;
+import org.apache.http.client.HttpRequestRetryHandler;
 import org.apache.http.client.entity.UrlEncodedFormEntity;
 import org.apache.http.client.methods.HttpDelete;
 import org.apache.http.client.methods.HttpGet;
@@ -74,6 +75,7 @@ import org.apache.http.entity.mime.conte
 import org.apache.http.entity.mime.content.StringBody;
 import org.apache.http.impl.client.AbstractHttpClient;
 import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
 import org.apache.http.message.BasicNameValuePair;
 import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
@@ -109,6 +111,9 @@ public class HTTPHC4Impl extends HTTPHCA
 
     private static final Logger log = LoggingManager.getLoggerForClass();
 
+    /** retry count to be used; defaults to 0 = disable retries */
+    private static final int RETRY_COUNT = JMeterUtils.getPropDefault("httpclient4.retrycount",
0);
+
     private static final String CONTEXT_METRICS = "jmeter_metrics"; // TODO hack, to be removed
later
 
     private static final HttpResponseInterceptor METRICS_SAVER = new HttpResponseInterceptor(){
@@ -447,7 +452,12 @@ public class HTTPHC4Impl extends HTTPHCA
 
             HttpParams clientParams = new DefaultedHttpParams(new BasicHttpParams(), DEFAULT_HTTP_PARAMS);
             
-            httpClient = new DefaultHttpClient(clientParams);
+            httpClient = new DefaultHttpClient(clientParams){
+                @Override
+                protected HttpRequestRetryHandler createHttpRequestRetryHandler() {
+                    return new DefaultHttpRequestRetryHandler(RETRY_COUNT, false); // set
retry count
+                }
+            };
             ((AbstractHttpClient) httpClient).addResponseInterceptor(new ResponseContentEncoding());
             ((AbstractHttpClient) httpClient).addResponseInterceptor(METRICS_SAVER); // HACK
             

Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=1164186&r1=1164185&r2=1164186&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Thu Sep  1 17:52:41 2011
@@ -60,6 +60,9 @@ To override the default local language f
 <h2>Incompatible changes</h2>
 
 <p>
+The HttpClient4 sampler as implemented in version 2.5 used a retry count of 3.
+As this can hide server errors, JMeter now sets the retry count to 0 to prevent any automatic
retries.
+This can be overridden by setting the JMeter property <b>httpclient4.retrycount</b>.
 </p>
 
 <h2>Bug fixes</h2>
@@ -67,6 +70,7 @@ To override the default local language f
 <h3>HTTP Samplers and Proxy</h3>
 <ul>
 <li>Bug 51750 - Retrieve all embedded resources doesn't follow IFRAME</li>
+<li>Change the default so the HttpClient 4 sampler does not retry</li>
 </ul>
 
 <h3>Other Samplers</h3>

Modified: jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=1164186&r1=1164185&r2=1164186&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
+++ jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml Thu Sep  1 17:52:41 2011
@@ -93,7 +93,7 @@ Latency is set to the time it takes to l
         <li>applets</li>
         <li>stylesheets</li>
         <li>external scripts</li>
-        <li>frames</li>
+        <li>frames, iframes</li>
         <li>background images (body, table, TD, TR)</li>
         <li>background sound</li>
         </ul>
@@ -353,6 +353,12 @@ Optional properties to allow change the 
 <note>Versions of JMeter before 2.5 returns only data response size (uncompressed if
request uses gzip/defate mode).
 <br></br>To return to settings before version 2.5, set the two properties to
false.</note>
 </p>
+<p>
+<b>Retry handling</b><br></br>
+In version 2.5 of JMeter, the HttpClient4 sampler used the default retry count, which was
3.
+As this can hide server errors, JMeter now sets the retry count to 0 to prevent any automatic
retries.
+This can be overridden by setting the JMeter property <b>httpclient4.retrycount</b>.
+</p>
 <links>
         <link href="test_plan.html#assertions">Assertion</link>
         <link href="build-web-test-plan.html">Building a Web Test Plan</link>



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org


Mime
View raw message