Re: Re: Deadlock in oscache 2.0

"Chris Miller" <[email protected]> Tue, 21 Oct 2003 08:22:34 +0100
Newsgroups gmane.comp.java.open-symphony.devel
Message-ID <[email protected]>
Sorry I should have mentioned that possibility earlier but I figured you'd
already seen that. I'll try to make this more clear in the documentation!

"David Rees" <[email protected]> wrote in message
news:[email protected]...
Duh,

Looking at the Cache class a bit more closely, it looks like I need to
either call putInCache or cancelUpdate each time I call getFromCache.

I missed this note in the changes.txt  :(

- When a NeedsRefreshException is thrown, it is now vital that the cache
  entry is either updated, or Cache.cancelUpdate(key) is called to release
  the lock on this cache entry. This is a consequence of the fix for
  [CACHE-42].

Thanks,
Dave

On Sat, October 18, 2003 at 1:19 pm, David Rees sent the following
> Hi Chris,
>
> Found the issue and created a test case.
>
> The problem occurs when a NeedsRefreshException is thrown when calling
> getFromCache, but putInCache is not called with the sam key.  Then the
> next time getFromCache is called, it never returns as it still thinks that
> someone is waiting to update the cache entry.  Seems like a workaround
> would be to always attempt to insert something (even null?) when a
> NeedsRefreshException is called.
>
> I've attached a simple test case which shows the issue.
>
> -Dave
>
> On Sat, October 18, 2003 1at 1:06 am, Chris Miller sent the following
>> I checked in a fix for a deadlock problem a couple of days ago. The only
>> time it occurs is when there are more than two threads waiting on a new
>> cache entry to be built, AND you call cancelUpdate(). So give the
>> current
>> CVS head a try, if that still doesn't solve the problem then file a Jira
>> issue and I'll investigate further. If you still see deadlocks then a
>> test
>> case would be very helpful in tracking down the problem.
>>
>> (As an aside, there was a nasty threading problem in 1.7.5 that caused a
>> memory leak and gradual performance degradation, bear that in mind if
>> you
>> roll back to 1.7.5 in the meantime).
>>
>> Chris
>



-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise
Linux in the Boardroom; in the Front Office; & in the Server Room
http://www.enterpriselinuxforum.com





-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54