Bug 42267

Summary: Concurrent GUI update failure
Product: JMeter - Now in Github Reporter: Rossen Raykov <rossen.raykov>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: major CC: rossen.raykov
Priority: P1    
Version: 2.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Error's stack trace
Suggested patch

Description Rossen Raykov 2007-04-26 08:26:30 UTC
Jmeter does not synchronize the GUI updates during recording sessions.
As are result when the request concurrency level is high enough (12 requests in
my case) the left three panel is miss mashed and the  “HTTP Proxy Server” panel
loses its Target Controller” selection.

I'm not familiar with the Jmeter code do do the best possible fix but making the
following two methods of  org.apache.jmeter.protocol.http.proxy.ProxyControl
from src/protocol/http helps to resolve the issue:

On line 557: 
private void placeSampler(HTTPSamplerBase sampler, TestElement[] subConfigs,
JMeterTreeNode myTarget)

On line 630:
private void removeValuesFromSampler(HTTPSamplerBase sampler, Collection
configurations)

This is quick and dirty fix and I would not fix the rest of the protocols which
may have the same issue.
Comment 1 Rossen Raykov 2007-04-26 12:16:52 UTC
Created attachment 20055 [details]
Error's stack trace

This is the original stack trace.
Comment 2 Alf Hogemark 2007-04-27 00:30:23 UTC
This seems to be the same issue as or at least quite related to bug 39427.
Comment 3 Alf Hogemark 2007-05-02 05:52:07 UTC
Created attachment 20088 [details]
Suggested patch

The patch makes the deliverSampler method synchronized.
Since the Proxy starts one thread for each request it receives, and each thread
adds a sample to the test plan via the "ProxyControl.deliverSampler" method,
the method has to be synchronized. The "deliverSampler" method interacts with
GUI components, which are normally run on the GUI thread, i.e. just one thread.
Therefore, only one thread at the time should be able to deliver samples.
The org.apache.jmeter.gui.GuiPackage class for example, does not seem to be
threadsafe, and methods in that class is called indirectly by deliverSampler.

You can reproduce this bug by pointing your browser to a web site with many
images on the page, so that the browsers issues multiple concurrent requests.
Comment 4 Sebb 2007-05-02 16:33:29 UTC
Thanks - applied to SVN in r534655
Comment 5 The ASF infrastructure team 2022-09-24 20:37:39 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1931