Author: sebb
Date: Fri Sep 23 13:56:51 2011
New Revision: 1174767
URL: http://svn.apache.org/viewvc?rev=1174767&view=rev
Log:
Bug 51882 - HTTPHC3Client uses a default retry count of 3, make it configurable
Modified:
jakarta/jmeter/trunk/bin/jmeter.properties
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
jakarta/jmeter/trunk/xdocs/changes.xml
Modified: jakarta/jmeter/trunk/bin/jmeter.properties
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/bin/jmeter.properties?rev=1174767&r1=1174766&r2=1174767&view=diff
==============================================================================
--- jakarta/jmeter/trunk/bin/jmeter.properties (original)
+++ jakarta/jmeter/trunk/bin/jmeter.properties Fri Sep 23 13:56:51 2011
@@ -330,6 +330,9 @@ log_level.jorphan=INFO
# Number of retries to attempt (default 0)
#httpclient4.retrycount=0
+# Number of retries to attempt (default 3)
+#httpclient3.retrycount=3
+
#---------------------------------------------------------------------------
# Results file configuration
#---------------------------------------------------------------------------
Modified:
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java?rev=1174767&r1=1174766&r2=1174767&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
(original)
+++
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
Fri Sep 23 13:56:51 2011
@@ -30,6 +30,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.zip.GZIPInputStream;
+import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HostConfiguration;
import org.apache.commons.httpclient.HttpClient;
@@ -88,6 +89,9 @@ public class HTTPHC3Impl extends HTTPHCA
private static final Logger log = LoggingManager.getLoggerForClass();
+ /** retry count to be used (default 3); 0 = disable retries */
+ private static final int RETRY_COUNT =
JMeterUtils.getPropDefault("httpclient3.retrycount", 3);
+
private static final String HTTP_AUTHENTICATION_PREEMPTIVE =
"http.authentication.preemptive"; // $NON-NLS-1$
private static final boolean canSetPreEmptive; // OK to set pre-emptive
auth?
@@ -439,6 +443,8 @@ public class HTTPHC3Impl extends HTTPHCA
if ( httpClient == null )
{
httpClient = new HttpClient(new SimpleHttpConnectionManager());
+
httpClient.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
+ new DefaultHttpMethodRetryHandler(RETRY_COUNT, false));
if (log.isDebugEnabled()) {
log.debug("Created new HttpClient:
@"+System.identityHashCode(httpClient));
}
Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=1174767&r1=1174766&r2=1174767&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Fri Sep 23 13:56:51 2011
@@ -145,6 +145,7 @@ This can be overridden by setting the JM
<h3>HTTP Samplers</h3>
<ul>
<li>Bug 51380 - Control reuse of cached SSL Context from iteration to
iteration</li>
+<li>Bug 51882 - HTTPHC3Client uses a default retry count of 3, make it
configurable</li>
</ul>
<h3>Other samplers</h3>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]