Bug 50659 - JMeter server does not support concurrent tests - prevent client from starting another
Summary: JMeter server does not support concurrent tests - prevent client from startin...
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.4
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
: 43168 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-26 09:34 UTC by jens_0
Modified: 2012-05-28 13:55 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jens_0 2011-01-26 09:34:06 UTC
In case multiple computers running JMeter servers are shared and could be used by different users running JMeter in client mode to run tests, the remote JMeter engine implementation should throw an exception (e.g. in configure) when it currently still is executing a test (that could be started by another JMeter client instance).

The current implementation stops the test it currently is running and starts the new one.
Comment 1 Sebb 2011-01-28 21:50:11 UTC
Agreed, the current behaviour is not ideal.

I don't know how easy it is to determine when the test has finished.
Comment 2 jens_0 2011-01-31 04:08:24 UTC
StandardJMeterEngine has
    private volatile boolean running = false;
maybe this could be read when Configure or runTest is called, and throw an exception which would be communicated back to RemoteJMeterEngineImpl and then back over RMI to the local JMeter instance?
Comment 3 Sebb 2011-02-02 15:15:21 UTC
(In reply to comment #0)
> 
> The current implementation stops the test it currently is running and starts
> the new one.

Are you sure? I just tried running 2 tests at once, and the server coped fine.

However, there is a small window between configuring a test and running it, in which case the original engine will be overwritten.

I suppose it's possible you hit that window?

==

It is possible to prevent more than one client running at once. 
This could be a server option (I don't think it should be enforced).

Otherwise, the server engine startup code should somehow ensure that the clients cannot interfere with each other.
Comment 4 Sebb 2011-02-02 17:55:20 UTC
Oops! 

Just realised that although a simple test such as the one I ran may work OK, the design of JMeter assumes that only one test is runninng at any one time. For example, there is only one set of JMeter properties.

Changing this would be a big undertaking, if it is indeed possible.

So it is necessary for the server to reject attempts to run two tests at once.

The 'running' flag is unfortunately not suitable, as it is true only whilst the main test is running - it is false during startup and shutdown. However it's easy enough to add another boolean.
Comment 5 Sebb 2011-02-02 18:12:55 UTC
Fixed:

URL: http://svn.apache.org/viewvc?rev=1066684&view=rev
Log:
Bug 50659 - JMeter server does not support concurrent tests - prevent client
from starting another

Modified:

jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/ClientJMeterEngine.java
  jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/JMeterEngine.java

jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java

jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java
  jakarta/jmeter/trunk/xdocs/changes.xml
Comment 6 jens_0 2011-02-03 07:26:44 UTC
(In reply to comment #5)
> Fixed:
> URL: http://svn.apache.org/viewvc?rev=1066684&view=rev

Hi,

I don't like the usability in the catch ServerException block in ClientJMeterEngine where you use System.exit(1); to exit JMeter. In case of a Gui-Run I would inform the user that the one of the used JMeter Servers is executing a test right now.
Comment 7 Sebb 2011-02-03 07:32:50 UTC
Good catch - I had only tested using non-GUI.

Needs to be looked at further.
Comment 8 Sebb 2011-02-03 19:01:54 UTC
Turned out to be a bit involved, but I think I've now fixed the code.

The fix is in nightly builds from r1067038.

If you can try one out and report back, that would be very helpful.


URL: http://svn.apache.org/viewvc?rev=1067038&view=rev
Log:
Bug 50659 - JMeter server does not support concurrent tests - prevent client from starting another
(part deux)
Remove thread from ClientJMeterEngine - if it is required for GUI, then let the GUI create the thread
This allows proper return of error conditions
Also replace System.exit() with interrupt() of RMI thread

Modified:
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/JMeter.java
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/ClientJMeterEngine.java
Comment 9 jens_0 2011-02-04 04:58:37 UTC
(In reply to comment #8)
> Turned out to be a bit involved, but I think I've now fixed the code.
> 
> The fix is in nightly builds from r1067038.
> 
Thanks. Commit 1067029 is also related I found out.

Can you explain me what that owner thread checking is about in RemoteJMeterEngineImpl?
Comment 10 Sebb 2011-02-04 05:31:12 UTC
(In reply to comment #9)
> Can you explain me what that owner thread checking is about in
> RemoteJMeterEngineImpl?

Start up involves 2-3 method calls:
- config
- setProperties (optional)
- runTest

Without owner checking, client A could call config, then client B, then client A could call runTest - which would use the wrong test plan.

Likewise for reset(), only the owner is allowed to reset, otherwise the GUI can kill off another test (I think this must be what you were experiencing originally).
Comment 11 jens_0 2011-02-07 06:41:11 UTC
> Without owner checking, client A could call config, then client B, then client
> A could call runTest - which would use the wrong test plan.
> 
> Likewise for reset(), only the owner is allowed to reset, otherwise the GUI can
> kill off another test (I think this must be what you were experiencing
> originally).

Ok, all right - thanks!
Comment 12 Philippe Mouawad 2012-05-28 13:55:43 UTC
*** Bug 43168 has been marked as a duplicate of this bug. ***
Comment 13 The ASF infrastructure team 2022-09-24 20:37:45 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2458