Re: Re: Deadlock in oscache 2.0

"David Rees" <[email protected]> Sat, 18 Oct 2003 13:19:22 -0700 (PDT)
Newsgroups gmane.comp.java.open-symphony.devel
Message-ID <[email protected]>
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
TestOsCache.java (application/octet-stream, 1.1 KB) - not displayed