Bug 59934 - CSSParser: several threads can compute the same CSS simultaneously when not cached yet (nightly build after 3.0)
Summary: CSSParser: several threads can compute the same CSS simultaneously when not c...
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 3.0
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-03 10:42 UTC by Jerome
Modified: 2016-11-27 18:10 UTC (History)
1 user (show)



Attachments
Patch based on PR #221 using caffeine (33.07 KB, patch)
2016-11-26 13:57 UTC, Felix Schumacher
Details | Diff
Add Iterable interface to URLCollection to get even nearer to PR #221 (2.67 KB, patch)
2016-11-27 11:50 UTC, Felix Schumacher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome 2016-08-03 10:42:34 UTC
The CssParser has several issues:
- race condition: several threads can compute the same CSS simultaneously when not cached yet,
- poor concurrency: synchronized map has poor concurrency level compared to guava's LoadingCache (which has similar concurrency performance when compared to ConcurrentHashMap).
Comment 1 Jerome 2016-08-03 10:43:32 UTC
Github pull request:
https://github.com/apache/jmeter/pull/221
Comment 2 Felix Schumacher 2016-11-26 13:57:52 UTC
Created attachment 34480 [details]
Patch based on PR #221 using caffeine

I tried to adapt PR #221 to caffeine, as discussed on that PR.
Comment 3 Felix Schumacher 2016-11-27 11:50:03 UTC
Created attachment 34483 [details]
Add Iterable interface to URLCollection to get even nearer to PR #221
Comment 4 Philippe Mouawad 2016-11-27 12:48:36 UTC
+1 for commit, thanks Felix (and Jérôme)
Comment 5 Felix Schumacher 2016-11-27 13:38:38 UTC
@Jerome and all others involved in this. Thanks for your contribution.

Date: Sun Nov 27 13:35:45 2016
New Revision: 1771589

URL: http://svn.apache.org/viewvc?rev=1771589&view=rev
Log:
Fix race-conditions in CssParser.
Based on a patch by Jerome Loisel (loisel.jerome at gmail.com)

This closes github pr #221
Bugzilla Id: 59934
Comment 6 Philippe Mouawad 2016-11-27 15:47:00 UTC
Author: pmouawad
Date: Sun Nov 27 15:39:42 2016
New Revision: 1771603

URL: http://svn.apache.org/viewvc?rev=1771603&view=rev
Log:
Bug 59934 - CSSParser: several threads can compute the same CSS simultaneously when not cached yet (nightly build after 3.0)
Fix compilation error
Bugzilla Id: 59934

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/CssParser.java
Comment 7 Philippe Mouawad 2016-11-27 16:16:41 UTC
Author: pmouawad
Date: Sun Nov 27 16:16:06 2016
New Revision: 1771604

URL: http://svn.apache.org/viewvc?rev=1771604&view=rev
Log:
Bug 59934 - CSSParser: several threads can compute the same CSS simultaneously when not cached yet (nightly build after 3.0)
ignore caffeine
Bugzilla Id: 59934
Comment 8 Felix Schumacher 2016-11-27 18:10:06 UTC
Date: Sun Nov 27 18:08:57 2016
New Revision: 1771619

URL: http://svn.apache.org/viewvc?rev=1771619&view=rev
Log:
Add missing license file for caffeine. Bugzilla Id: 59934

Added:
    jmeter/trunk/licenses/bin/caffeine-2.3.5.txt