Bug 59934

Summary: CSSParser: several threads can compute the same CSS simultaneously when not cached yet (nightly build after 3.0)
Product: JMeter - Now in Github Reporter: Jerome <loisel.jerome>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: enhancement CC: p.mouawad
Priority: P2    
Version: 3.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Patch based on PR #221 using caffeine
Add Iterable interface to URLCollection to get even nearer to PR #221

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
Comment 9 The ASF infrastructure team 2022-09-24 20:38:04 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4035