Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-09 Thread Philippe Mouawad
On Sun, Oct 9, 2011 at 1:14 PM, sebb wrote: > On 9 October 2011 10:50, Philippe Mouawad > wrote: > > Hello Sebb, > > Regarding the cloning of a Sampler you mention in you mail > "Unfortunately, > > cloning the sampler is not easy.", > > could you give more explanations on why it is not easy to c

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-09 Thread sebb
On 9 October 2011 10:50, Philippe Mouawad wrote: > Hello Sebb, > Regarding the cloning of a Sampler you mention in you mail "Unfortunately, > cloning the sampler is not easy.", > could you give more explanations on why it is not easy to clone the sampler > ? It's easy to call clone on the sampler

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-09 Thread Philippe Mouawad
Hello Sebb, Regarding the cloning of a Sampler you mention in you mail "Unfortunately, cloning the sampler is not easy.", could you give more explanations on why it is not easy to clone the sampler ? I think I am missing something. Thank you Regards Philippe On Fri, Oct 7, 2011 at 2:46 AM, sebb

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-07 Thread Philippe Mouawad
You are right there will be an issue with currentRequest and any sampler that has modifiable instance variables. So my fix only fixes CookieManager issue. That's why you wanted to clone Sampler, clear for me now and I agree. Regards Philippe On Fri, Oct 7, 2011 at 11:36 AM, sebb wrote: > On 7

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-07 Thread sebb
On 7 October 2011 09:45, Philippe Mouawad wrote: > Hello Sebb, > By proxy do you mean: > Proxy.newProxyInstance and InvocationHandler, if so aren't we missing an > Interface (Sampler does not do the job and it does not use Entry parameter). > If so I agree lot of job. Yes. > Regarding the need t

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-07 Thread Philippe Mouawad
Hello Sebb, By proxy do you mean: Proxy.newProxyInstance and InvocationHandler, if so aren't we missing an Interface (Sampler does not do the job and it does not use Entry parameter). If so I agree lot of job. Regarding the need to clone sampler, why do we need this, is there some data that may be

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-06 Thread sebb
On 7 October 2011 00:00, sebb wrote: > On 6 October 2011 22:17, Philippe Mouawad wrote: >> Hello Sebb, >> My responses below, there is one remaining point and I think we can go for >> implementation (i can do it if you agree). >> >> Regards >> Philippe >> >> On Thu, Oct 6, 2011 at 12:01 AM, sebb

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-06 Thread sebb
On 6 October 2011 22:17, Philippe Mouawad wrote: > Hello Sebb, > My responses below, there is one remaining point and I think we can go for > implementation (i can do it if you agree). > > Regards > Philippe > > On Thu, Oct 6, 2011 at 12:01 AM, sebb wrote: > >> On 5 October 2011 21:46, Philippe M

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-06 Thread Philippe Mouawad
Hello Sebb, My responses below, there is one remaining point and I think we can go for implementation (i can do it if you agree). Regards Philippe On Thu, Oct 6, 2011 at 12:01 AM, sebb wrote: > On 5 October 2011 21:46, Philippe Mouawad > wrote: > > Hello Sebb, all, > > First a note regarding >

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-05 Thread sebb
On 5 October 2011 21:46, Philippe Mouawad wrote: > Hello Sebb, all, > First a note regarding > "If cookies are being ignored, then the cookie manager property can just be > cleared - i.e. there is no cookie manager." > > Just to be sure I understand, you mean "Cookies of embedded resources are > n

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-05 Thread Philippe Mouawad
Hello Sebb, all, First a note regarding "If cookies are being ignored, then the cookie manager property can just be cleared - i.e. there is no cookie manager." Just to be sure I understand, you mean "Cookies of embedded resources are not used", because download of embedded resources may require JS

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-03 Thread Philippe Mouawad
I opened : https://issues.apache.org/bugzilla/show_bug.cgi?id=51942 and provided patch. Regards Philippe On Mon, Oct 3, 2011 at 6:16 PM, Philippe Mouawad wrote: > Hello, > By the way I think there is also an issue in CacheManager due to the use > of InheritableThreadLocal (which is not thread

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-03 Thread Philippe Mouawad
Hello, By the way I think there is also an issue in CacheManager due to the use of InheritableThreadLocal (which is not thread safe). Indeed this Map is shared by concurrent children thread, so Map is accessed concurrently but not thread-safe => ISSUE I made a little main sample that I can attach

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-03 Thread sebb
On 3 October 2011 16:07, Shmuel Krakower wrote: > Hi, > Why isn't Cookie manager implemented the way Cache manager is (using a > thread local hash map)? Probably mainly historical. Cookies are currently stored in an ArrayList, but one could perhaps use a HashMap instead. Though that won't work i

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-03 Thread Shmuel Krakower
Hi, Why isn't Cookie manager implemented the way Cache manager is (using a thread local hash map)? If it would be implemented the same way - the fix should be the same as on the Cache manager case ( https://issues.apache.org/bugzilla/show_bug.cgi?id=51752) Regards, Shmuel Krakower. On Mon, Oct

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-03 Thread sebb
On 3 October 2011 15:39, Philippe Mouawad wrote: > On Mon, Oct 3, 2011 at 4:31 PM, sebb wrote: > >> On 3 October 2011 14:04, Philippe Mouawad >> wrote: >> > You are right, >> > Patch was just about quick fix before the more impacting fix. >> > >> > Here are my propositions regarding this more im

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-03 Thread Philippe Mouawad
On Mon, Oct 3, 2011 at 4:31 PM, sebb wrote: > On 3 October 2011 14:04, Philippe Mouawad > wrote: > > You are right, > > Patch was just about quick fix before the more impacting fix. > > > > Here are my propositions regarding this more impacting fix: > > > > - Add an option to make conc downloa

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-03 Thread sebb
On 3 October 2011 14:04, Philippe Mouawad wrote: > You are right, > Patch was just about quick fix before the more impacting fix. > > Here are my propositions regarding this more impacting fix: > >   - Add an option to make conc download use or not cookie, default value >   will be false. >   - In

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-03 Thread Philippe Mouawad
You are right, Patch was just about quick fix before the more impacting fix. Here are my propositions regarding this more impacting fix: - Add an option to make conc download use or not cookie, default value will be false. - In AsyncSampler make a Clone with current cookies of Parent

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-03 Thread sebb
On 3 October 2011 13:14, Philippe Mouawad wrote: > Sebb, > Do you want me to provide a patch with ConcurrentHashMap where I will have > to handle null keys and values (not same behaviour as HashMap) or we forget > about this approach ? I don't think we have yet decided how best to handle concurre

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-03 Thread Philippe Mouawad
Sebb, Do you want me to provide a patch with ConcurrentHashMap where I will have to handle null keys and values (not same behaviour as HashMap) or we forget about this approach ? Regards Philippe On Mon, Oct 3, 2011 at 1:58 PM, Philippe Mouawad wrote: > Hello, > Just a little update on my test.

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-03 Thread Philippe Mouawad
Hello, Just a little update on my test. I added a clear and gc before each Map instanciation and results are different: - HashMapput:645 - ConcurrentHashMapput:832 - ConcurrentReaderHashMapput:620 - HashMap get:17 - ConcurrentHashMap get:32 - ConcurrentReaderHashMap get:60 So i

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-03 Thread sebb
On 3 October 2011 12:15, Rainer Jung wrote: > On 02.10.2011 23:17, Philippe Mouawad wrote: >> Ok, hope we can do the same. > > See https://issues.apache.org/jira/browse/XMLBEANS-447 > > We are not the only people, who doubt it's correct to include that class ... > > There was also a discussion som

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-03 Thread Rainer Jung
On 02.10.2011 23:17, Philippe Mouawad wrote: > Ok, hope we can do the same. See https://issues.apache.org/jira/browse/XMLBEANS-447 We are not the only people, who doubt it's correct to include that class ... There was also a discussion some time ago in another ASF project, because the Sun licens

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-02 Thread Philippe Mouawad
Ok, hope we can do the same. I must say I don't understand why ConcurrentReaderHashMap is not in JDK. Regards Philippe On Sun, Oct 2, 2011 at 11:07 PM, sebb wrote: > On 2 October 2011 19:39, Philippe Mouawad > wrote: > > Hello Sebb, > > XMLBeans which is an Apache project under Apache Licence

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-02 Thread sebb
On 2 October 2011 19:39, Philippe Mouawad wrote: > Hello Sebb, > XMLBeans which is an Apache project under Apache Licence has included it : > >   - >   > http://massapi.com/source/xmlbeans-2.5.0/src/common/org/apache/xmlbeans/impl/common/ConcurrentReaderHashMap.java.html > > > Couldn't we do the

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-02 Thread Philippe Mouawad
Hello Sebb, XMLBeans which is an Apache project under Apache Licence has included it : - http://massapi.com/source/xmlbeans-2.5.0/src/common/org/apache/xmlbeans/impl/common/ConcurrentReaderHashMap.java.html Couldn't we do the same ? Regards Philippe On Sun, Oct 2, 2011 at 4:29 PM, sebb w

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-02 Thread sebb
On 2 October 2011 15:20, Rainer Jung wrote: > On 02.10.2011 15:49, sebb wrote: >> On 1 October 2011 14:33, Philippe Mouawad wrote: >>> A little additional note, >>> There is an implementation of Concurrent map by doug lea in concurrent.jar >>> called ConcurrentReaderHashMap >>> that has same perf

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-02 Thread Rainer Jung
On 02.10.2011 15:49, sebb wrote: > On 1 October 2011 14:33, Philippe Mouawad wrote: >> A little additional note, >> There is an implementation of Concurrent map by doug lea in concurrent.jar >> called ConcurrentReaderHashMap >> that has same performance as HashMap in read and a little less on writ

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-02 Thread sebb
On 1 October 2011 14:33, Philippe Mouawad wrote: > A little additional note, > There is an implementation of Concurrent map by doug lea in concurrent.jar > called ConcurrentReaderHashMap > that has same performance as HashMap in read and a little less on write. > But performances are much better t

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-01 Thread Philippe Mouawad
Results on my computer: - HashMapput:693 - ConcurrentHashMapput:981 - ConcurrentReaderHashMapput:845 - HashMap get:63 - ConcurrentHashMap get:162 - ConcurrentReaderHashMap get:63 Of course this sample is not multithreaded to see impact when no conc download is used. In multithre

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-01 Thread Philippe Mouawad
A little additional note, There is an implementation of Concurrent map by doug lea in concurrent.jar called ConcurrentReaderHashMap that has same performance as HashMap in read and a little less on write. But performances are much better than ConcurrentHashMap. So maybe a better alternative but req

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-01 Thread sebb
On 1 October 2011 12:38, Philippe Mouawad wrote: > On Sat, Oct 1, 2011 at 12:57 PM, sebb wrote: > >> On 1 October 2011 10:53, Philippe Mouawad >> wrote: >> > Hello Milamber, Sebb, All, >> > Regarding 51919 < >> https://issues.apache.org/bugzilla/show_bug.cgi?id=51919>, >> > I wonder if there is

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-01 Thread Philippe Mouawad
On Sat, Oct 1, 2011 at 12:57 PM, sebb wrote: > On 1 October 2011 10:53, Philippe Mouawad > wrote: > > Hello Milamber, Sebb, All, > > Regarding 51919 < > https://issues.apache.org/bugzilla/show_bug.cgi?id=51919>, > > I wonder if there is not an issue in JMeterVariables access introduced by > > co

Re: [Bug 51919] Random ConcurrentModificationException or NoSuchElementException in CookieManager#removeMatchingCookies when using Concurrent Download

2011-10-01 Thread sebb
On 1 October 2011 10:53, Philippe Mouawad wrote: > Hello Milamber, Sebb, All, > Regarding 51919 , > I wonder if there is not an issue in JMeterVariables access introduced by > concurrent download. > Initially I think JMeterVariables were no