forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Williams" <william...@gmail.com>
Subject Re: Concurrency testing of the locationmap throws errors
Date Mon, 30 Jun 2008 12:34:43 GMT
On Mon, Jun 30, 2008 at 8:12 AM, Thorsten Scherler
<thorsten.scherler.ext@juntadeandalucia.es> wrote:
> On Mon, 2008-06-30 at 08:05 -0400, Tim Williams wrote:
> ...
>> > I am ATM playing around and it happens in
>> > LocationMapModule.getLocationMap() but I am not sure how I can prevent
>> > it.
>>
>> Try making the entire method synchronized instead of just the blocks.
>> This may not be the end solution but will let you quickly see if
>> there's concurrency problems when the subsequent requests come in
>> before the LM is fully built.  Just my top of the head thought, sorry,
>> I don't have time to look further right now.
>
> Yeah, meanwhile I did that for the LocationMapModule
>  private synchronized LocationMap getLocationMap() throws Exception {
> ...
>
> and as well for LocationMap.build(final Configuration configuration)
>  public synchronized void build
>
> Now "just" the first lookup fails, meaning it cured quite a bit but not
> fully yet.
>
> Keeping you informed and thanks for your feedback tim.

I reckon in that case, it's either the caching or its deeper in the
actual LM/nodes.  You could try turning off caching completely and see
if it helps.  Or, you could change the implementation from a HashMap
to a ConcurrentHashMap and see if that helps.

--tim

Mime
View raw message