Skip to content
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

JMeter server does not support concurrent tests - prevent client from starting another #2458

Closed
asfimport opened this issue Jan 26, 2011 · 11 comments

Comments

@asfimport
Copy link
Collaborator

jens_0 (Bug 50659):
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.

Severity: normal
OS: Windows XP

Duplicates:

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
Agreed, the current behaviour is not ideal.

I don't know how easy it is to determine when the test has finished.

@asfimport
Copy link
Collaborator Author

jens_0 (migrated from Bugzilla):
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?

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
(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.

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
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.

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
Fixed:

URL: http://svn.apache.org/viewvc?rev=1066684&view=rev
Log:
#2458 - 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

@asfimport
Copy link
Collaborator Author

jens_0 (migrated from Bugzilla):
(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.

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
Good catch - I had only tested using non-GUI.

Needs to be looked at further.

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
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:
#2458 - 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

@asfimport
Copy link
Collaborator Author

jens_0 (migrated from Bugzilla):
(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?

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
(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).

@asfimport
Copy link
Collaborator Author

jens_0 (migrated from Bugzilla):

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant