This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 913735d  Fix ProxyControl timer that prevents correct shutdown
913735d is described below

commit 913735db54bf5a2e0a1461aee0e110df19512424
Author: Felix Schumacher <[email protected]>
AuthorDate: Wed Jun 17 12:20:21 2020 +0200

    Fix ProxyControl timer that prevents correct shutdown
    
    Regression introduced with Bug 64400
    
    Bugzilla Id: 64479
---
 .../java/org/apache/jmeter/protocol/http/proxy/ProxyControl.java | 9 ++++++++-
 xdocs/changes.xml                                                | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
 
b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
index 9016120..3d86b4d 100644
--- 
a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
+++ 
b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
@@ -286,12 +286,13 @@ public class ProxyControl extends GenericController 
implements NonTestElement {
     // accessed from Swing-Thread, only
     private String oldPrefix = null;
 
+    private transient javax.swing.Timer sampleWorkerTimer;
+
     public ProxyControl() {
         setPort(DEFAULT_PORT);
         setExcludeList(new HashSet<>());
         setIncludeList(new HashSet<>());
         setCaptureHttpHeaders(true); // maintain original behaviour
-        new javax.swing.Timer(200, this::putSamplesIntoModel).start();
     }
 
     /**
@@ -508,6 +509,8 @@ public class ProxyControl extends GenericController 
implements NonTestElement {
             log.error("Could not initialise key store", e);
             throw e;
         }
+        sampleWorkerTimer = new javax.swing.Timer(200, 
this::putSamplesIntoModel);
+        sampleWorkerTimer.start();
         notifyTestListenersOfStart();
         try {
             server = new Daemon(getPort(), this);
@@ -738,6 +741,10 @@ public class ProxyControl extends GenericController 
implements NonTestElement {
             notifyTestListenersOfEnd();
             server = null;
         }
+        if (sampleWorkerTimer != null) {
+            sampleWorkerTimer.stop();
+            sampleWorkerTimer = null;
+        }
     }
 
     public String[] getCertificateDetails() {
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index aaeb561..2e31684 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -129,6 +129,7 @@ Summary
 
 <h3>HTTP Samplers and Test Script Recorder</h3>
 <ul>
+  <li><bug>64479</bug>Regression: HTTP(s) Script Recorder prevents proper 
shutdown in non-GUI mode</li>
 </ul>
 
 <h3>Other Samplers</h3>

Reply via email to