Bug 39219 - HTTP Server: You can't stop it after File->Open
Summary: HTTP Server: You can't stop it after File->Open
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.5
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-06 08:55 UTC by balthazar bley
Modified: 2011-09-14 13:57 UTC (History)
1 user (show)



Attachments
Stops Mirror or Proxy on Load, Reload or close of project (9.34 KB, patch)
2011-09-11 17:19 UTC, Philippe Mouawad
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description balthazar bley 2006-04-06 08:55:13 UTC
If you run the HTTP Proxy and you reload some other jmx file
using the menue File->Open,
then the running proxy server is still running in the background,
but it vanished from the GUI. 
A newly created HTTP Proxy server has no effect (but you don't get
an error message about a port being already in use). 

The only way to get rid of the proxy server is to kill Jmeter.
Comment 1 Sebb 2007-09-02 11:06:40 UTC
Same probably applies to the Mirror Server.

Possible fixes:
* kill the servers if a new test plan is loaded
* prevent a new test plan from being loaded if servers are active
Comment 2 Philippe Mouawad 2011-09-11 17:19:08 UTC
Created attachment 27485 [details]
Stops Mirror or Proxy on Load, Reload or close of project

Hello,
1) I added an Interface called IStopable implementer by HttpMirrorServer and Daemon.
2) ProxyControl and HttpMirrorControl register/unregister on start/stop
3) A new Action called StopStoppables which does the stopServer calls.
4) Action is called through ActionRouter.getInstance().doActionNow in Load, Close and LoadRecentProject (through Load inheritence)

Test scenario is:
- Create a new Test Plan
- Add a mirror or proxy
- Start it
- Close project or Open a recent one or open a new one, 
- Proxy or mirror are stopped and bug is fixed



Regards
Philippe Mouawad
Comment 3 Sebb 2011-09-14 13:57:38 UTC
Thanks very much for the patch.

I applied it with minor changes (renamed IStopable => Stoppable) and added check for null guiPackage in Mirror Server (which can be run non-Gui).

URL: http://svn.apache.org/viewvc?rev=1170627&view=rev
Log:
Bug 39219 - HTTP Server: You can't stop it after File->Open

Added:
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/gui/Stoppable.java   (with props)
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/gui/action/StopStoppables.java   (with props)
Modified:
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/gui/action/ActionNames.java
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/gui/action/Close.java
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/gui/action/Load.java
   jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorControl.java
   jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorServer.java
   jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Daemon.java
   jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
   jakarta/jmeter/trunk/xdocs/changes.xml
Comment 4 The ASF infrastructure team 2022-09-24 20:37:36 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1706