You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by fs...@apache.org on 2015/04/26 13:51:10 UTC

svn commit: r1676099 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java xdocs/changes.xml

Author: fschumacher
Date: Sun Apr 26 11:51:09 2015
New Revision: 1676099

URL: http://svn.apache.org/r1676099
Log:
Don't call sampleEnd twice in HTTPHC4Impl when a RuntimeException or an IOException occurs in the sample method.

Bugzilla Id: 57858

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

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java?rev=1676099&r1=1676098&r2=1676099&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java Sun Apr 26 11:51:09 2015
@@ -411,15 +411,22 @@ public class HTTPHC4Impl extends HTTPHCA
             res = resultProcessing(areFollowingRedirect, frameDepth, res);
 
         } catch (IOException e) {
-            res.sampleEnd();
             log.debug("IOException", e);
-           // pick up headers if failed to execute the request
+            if (res.getEndTime() == 0) {
+                res.sampleEnd();
+            }
+            // pick up headers if failed to execute the request
+            if (res.getRequestHeaders() != null) {
+                log.debug("Overwriting request old headers: " + res.getRequestHeaders());
+            }
             res.setRequestHeaders(getConnectionHeaders((HttpRequest) localContext.getAttribute(ExecutionContext.HTTP_REQUEST)));
             errorResult(e, res);
             return res;
         } catch (RuntimeException e) {
-            res.sampleEnd();
             log.debug("RuntimeException", e);
+            if (res.getEndTime() == 0) {
+                res.sampleEnd();
+            }
             errorResult(e, res);
             return res;
         } finally {

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1676099&r1=1676098&r2=1676099&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sun Apr 26 11:51:09 2015
@@ -120,6 +120,7 @@ Summary
 <h3>HTTP Samplers and Test Script Recorder</h3>
 <ul>
     <li><bug>57806</bug>"audio/x-mpegurl" mime type is erroneously considered as binary by ViewResultsTree. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
+    <li><bug>57858</bug>Don't call sampleEnd twice in HTTPHC4Impl when a RuntimeException or an IOException occurs in the sample method.</li>
 </ul>
 
 <h3>Other Samplers</h3>