New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTPHC3Client uses a default retry count of 3, make it configurable #2561
Comments
@pmouawad (migrated from Bugzilla): BUG_51880.patchIndex: src/core/org/apache/jmeter/engine/StandardJMeterEngine.java
===================================================================
--- src/core/org/apache/jmeter/engine/StandardJMeterEngine.java (revision 1174430)
+++ src/core/org/apache/jmeter/engine/StandardJMeterEngine.java (working copy)
@@ -570,9 +570,11 @@
* </ul>
*/
private void stopAllThreads() {
- // ConcurrentHashMap does not need synch. here
- for (JMeterThread item : allThreads.keySet()) {
- item.stop();
+ for (Iterator<Map.Entry<JMeterThread, Thread>> iterator = allThreads.entrySet().iterator(); iterator.hasNext();) {
+ Map.Entry<JMeterThread, Thread> entry = iterator.next();
+ entry.getKey().stop();
+ // 51880
+ entry.getValue().interrupt();
}
}
|
@pmouawad (migrated from Bugzilla): ISSUE_51882.patchIndex: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
===================================================================
--- src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java (revision 1174132)
+++ src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java (working copy)
@@ -30,6 +30,7 @@
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;
@@ -87,6 +88,8 @@
public class HTTPHC3Impl extends HTTPHCAbstractImpl {
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("httpclient3.retrycount", 0);
private static final String HTTP_AUTHENTICATION_PREEMPTIVE = "http.authentication.preemptive"; // $NON-NLS-1$
@@ -439,6 +442,8 @@
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));
}
Index: bin/jmeter.properties
===================================================================
--- bin/jmeter.properties (revision 1174675)
+++ bin/jmeter.properties (working copy)
@@ -330,6 +330,9 @@
# Number of retries to attempt (default 0)
#httpclient4.retrycount=0
+# Number of retries to attempt (default 0)
+#httpclient3.retrycount=0
+
#---------------------------------------------------------------------------
# Results file configuration
#--------------------------------------------------------------------------- |
@pmouawad (migrated from Bugzilla): Created attachment SimpleTest.jmx: Test Case that shows error when retry is set to 0 |
Sebb (migrated from Bugzilla): I've applied the patch, but changed the default to 3 for compatibility. We can easily change this later. URL: http://svn.apache.org/viewvc?rev=1174767&view=rev Modified: |
@pmouawad (Bug 51882):
Add a property named :
#httpclient3.retrycount=0
to enable configuring Retry count which will now default to 0 (no retry)
Regards
Philippe Mouawad
OS: All
The text was updated successfully, but these errors were encountered: