You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2017/06/22 15:11:18 UTC

[Bug 61209] New: Save Responses to a File does not seem to be thread safe in Jmeter 3.2

https://bz.apache.org/bugzilla/show_bug.cgi?id=61209

            Bug ID: 61209
           Summary: Save Responses to a File does not seem to be thread
                    safe in Jmeter 3.2
           Product: JMeter
           Version: 3.2
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Main
          Assignee: issues@jmeter.apache.org
          Reporter: edcrane@itzed-solutions.co.uk
  Target Milestone: ---

I am using Jmeter 3.2 via the jmeter-maven-plugin (2.2.0) via jenkins

I'm not sure whether this would be an issue with JMeter or the plugin. But I
have to raise an issue on one first and I chose Jmeter.

I have a simple jmx file which reads a single line or data from CSV file (CSV
Data Set Config), uses the CSV data to build a SQL query to a DB via JDBC
Request and then uses Save Responses to a File to save the data into a filename
which is created using the CSV data (identical to the CSV Data used in the SQL
query).

The thread group in the JMX runs 200 threads with a rampup of 1s

I was previously using Jmeter 2.13 via the jmeter-maven-plugin (1.10.1) via
jenkins. With this version all of the 200 unique files are always generated.

When I switched to Jmeter 3.2 via the jmeter-maven-plugin (2.2.0) I found that
not all of the 200 files were created, some were at random skipped. I did some
digging in the *.log and found;

CSV Data Set Config opens the config files (based on threadnum) 1-200 as
expected
JDBC Request sends 200 unique queries based on the CSV data as expected
Save Responses to a File writes 200 files, but some filenames are saved more
than once. i.e. instead of
filename_10_1,filename_10_2,filename_10_10,filename_10_19 .....etc being saved
I get  filename_10_1,filename_10_2,filename_10_2,filename_10_2 .... etc saved.
Resulting in a variable number of filenames being created. But less than the
200 expected

So to debug further I set the rampup to 200 ... so that none of the threads
would overlap (DB response is 5-30ms). When slowed down all of the 200 unique
filenames are saved.

This indicates to me that something within the Save Responses to a File is not
Thread Safe ... as when the threads run concurrently there are issues .

I am running on Ubuntu 16.04

 I couldn't find any issues already covering this fault. If you need further
information please let me know

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61209] Save Responses to a File does not seem to be thread safe in Jmeter 3.2

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61209

Felix Schumacher <fe...@internetallee.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #2 from Felix Schumacher <fe...@internetallee.de> ---
@itzed can you look, if you have exceptions in your jmeter.log file?
Is the attached test plan like the one you described?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61209] Save Responses to a File does not seem to be thread safe in Jmeter 3.2

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61209

itzed <ed...@itzed-solutions.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #4 from itzed <ed...@itzed-solutions.co.uk> ---
Felix,

I took a look and your testplan looks significantly different to mine (see
attached example with proprietary info removed)

I think the issues are different.

I saw no exceptions in the log. It is tricky to attach as this also contains
proprietary information and would take some time to sanitise.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61209] Save Responses to a File does not seem to be thread safe in Jmeter 3.2

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61209

--- Comment #3 from itzed <ed...@itzed-solutions.co.uk> ---
Created attachment 35081
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35081&action=edit
Example JMX

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61209] Save Responses to a File does not seem to be thread safe in Jmeter 3.2

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61209

--- Comment #1 from Felix Schumacher <fe...@internetallee.de> ---
Created attachment 35068
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35068&action=edit
Test that shows some errors (might be the ones that this bug is about)

I tried to setup a simple test plan, that shows the described behaviour.

In this plan, there are 200 threads looping 100 times and doing a java test
sample. All of that is listened by the result saver, that saves its results
into files that are prefixed by /tmp/test_${__threadNum}_

In my runs I get a few exceptions, when the filename gets calculated:

2017-06-22 20:23:56,823 ERROR o.a.j.t.ListenerNotifier: Detected problem in
Listener.
java.lang.NullPointerException: null
>-------at org.apache.jmeter.services.FileServer.resolveBaseRelativeName(FileServer.java:571) ~[ApacheJMeter_core.jar:3.3-SNAPSHOT.20170622]
>-------at org.apache.jmeter.reporters.ResultSaver.makeFileName(ResultSaver.java:218) ~[ApacheJMeter_core.jar:3.3-SNAPSHOT.20170622]
>-------at org.apache.jmeter.reporters.ResultSaver.saveSample(ResultSaver.java:185) ~[ApacheJMeter_core.jar:3.3-SNAPSHOT.20170622]
>-------at org.apache.jmeter.reporters.ResultSaver.processSample(ResultSaver.java:162) ~[ApacheJMeter_core.jar:3.3-SNAPSHOT.20170622]
>-------at org.apache.jmeter.reporters.ResultSaver.sampleOccurred(ResultSaver.java:152) ~[ApacheJMeter_core.jar:3.3-SNAPSHOT.20170622]
>-------at org.apache.jmeter.threads.ListenerNotifier.notifyListeners(ListenerNotifier.java:65) [ApacheJMeter_core.jar:3.3-SNAPSHOT.20170622]
>-------at org.apache.jmeter.threads.JMeterThread.notifyListeners(JMeterThread.java:903) [ApacheJMeter_core.jar:3.3-SNAPSHOT.20170622]
>-------at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:530) [ApacheJMeter_core.jar:3.3-SNAPSHOT.20170622]
>-------at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:425) [ApacheJMeter_core.jar:3.3-SNAPSHOT.20170622]
>-------at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:254) [ApacheJMeter_core.jar:3.3-SNAPSHOT.20170622]
>-------at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]

Now I have two questions. First, is this the same bug that itzed reported and
second, why is the filename null.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61209] Save Responses to a File does not seem to be thread safe in Jmeter 3.2

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61209

--- Comment #6 from Felix Schumacher <fe...@internetallee.de> ---
(In reply to Philippe Mouawad from comment #5)
> Hello
> @Felix, I am not able to see any issue with result-saver-threads.jmx, what
> are you seeing ?

I got null pointer exceptions in jmeter.log as described in #1

> 
> @Itzed, in the test plan you attached I see many problems:
> - You use ${__threadNum} in CSV Data Set Config, see
> http://jmeter.apache.org/usermanual/functions.html#__threadNum
> - You number your files based on your own CSV data, not the number generated
> by ResultSaver
> 
> So for now , I am closing issue as WORKSFORME as I cannot reproduce issue.
> 
> Feel free to reopen with a test plan reproducing issue.
> Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61209] Save Responses to a File does not seem to be thread safe in Jmeter 3.2

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61209

--- Comment #8 from Felix Schumacher <fe...@internetallee.de> ---
(In reply to Philippe Mouawad from comment #7)
> (In reply to Felix Schumacher from comment #6)
> > (In reply to Philippe Mouawad from comment #5)
> > > Hello
> > > @Felix, I am not able to see any issue with result-saver-threads.jmx, what
> > > are you seeing ?
> > 
> > I got null pointer exceptions in jmeter.log as described in #1
> 
> Do you still get them ?

Yes. I tried to run it with 

$ ./bin/jmeter -n -t /tmp/result-saver-threads.jmx

After the test run I check the created files with

$ ls /tmp/test_* | wc -l

If there are not 20.000 files, than there should be an exception in jmeter.log
like the following:

ERROR o.a.j.t.ListenerNotifier: Detected problem in Listener.
java.lang.NullPointerException: null
>-------at org.apache.jmeter.services.FileServer.resolveBaseRelativeName(FileServer.java:571) ~[ApacheJMeter_core.jar:3.3-SNAPSHOT.20170716]
>-------at org.apache.jmeter.reporters.ResultSaver.makeFileName(ResultSaver.java:218) ~[ApacheJMeter_core.jar:3.3-SNAPSHOT.20170716]
>-------at org.apache.jmeter.reporters.ResultSaver.saveSample(ResultSaver.java:185) ~[ApacheJMeter_core.jar:3.3-SNAPSHOT.20170716]
>-------at org.apache.jmeter.reporters.ResultSaver.processSample(ResultSaver.java:162) ~[ApacheJMeter_core.jar:3.3-SNAPSHOT.20170716]
>-------at org.apache.jmeter.reporters.ResultSaver.sampleOccurred(ResultSaver.java:152) ~[ApacheJMeter_core.jar:3.3-SNAPSHOT.20170716]
>-------at org.apache.jmeter.threads.ListenerNotifier.notifyListeners(ListenerNotifier.java:65) [ApacheJMeter_core.jar:3.3-SNAPSHOT.20170716]
>-------at org.apache.jmeter.threads.JMeterThread.notifyListeners(JMeterThread.java:903) [ApacheJMeter_core.jar:3.3-SNAPSHOT.20170716]
>-------at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:530) [ApacheJMeter_core.jar:3.3-SNAPSHOT.20170716]
>-------at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:425) [ApacheJMeter_core.jar:3.3-SNAPSHOT.20170716]
>-------at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:254) [ApacheJMeter_core.jar:3.3-SNAPSHOT.20170716]
>-------at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61209] Save Responses to a File does not seem to be thread safe in Jmeter 3.2

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61209

--- Comment #7 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
(In reply to Felix Schumacher from comment #6)
> (In reply to Philippe Mouawad from comment #5)
> > Hello
> > @Felix, I am not able to see any issue with result-saver-threads.jmx, what
> > are you seeing ?
> 
> I got null pointer exceptions in jmeter.log as described in #1

Do you still get them ?
> 
> > 
> > @Itzed, in the test plan you attached I see many problems:
> > - You use ${__threadNum} in CSV Data Set Config, see
> > http://jmeter.apache.org/usermanual/functions.html#__threadNum
> > - You number your files based on your own CSV data, not the number generated
> > by ResultSaver
> > 
> > So for now , I am closing issue as WORKSFORME as I cannot reproduce issue.
> > 
> > Feel free to reopen with a test plan reproducing issue.
> > Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61209] Save Responses to a File does not seem to be thread safe in Jmeter 3.2

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61209

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om
         Resolution|---                         |WORKSFORME
             Status|NEW                         |RESOLVED

--- Comment #5 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Hello
@Felix, I am not able to see any issue with result-saver-threads.jmx, what are
you seeing ?

@Itzed, in the test plan you attached I see many problems:
- You use ${__threadNum} in CSV Data Set Config, see
http://jmeter.apache.org/usermanual/functions.html#__threadNum
- You number your files based on your own CSV data, not the number generated by
ResultSaver

So for now , I am closing issue as WORKSFORME as I cannot reproduce issue.

Feel free to reopen with a test plan reproducing issue.
Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.