Hi all,
in a servlet environment, you sometimes have to claim back a thread for your
thread pool.
Jetty has a nice "denial of service attack" filter and a setting
(maxIdleTime) interrupting servlet threads if nothing comes out (nothing is
written in the pipe).
Well it does not play well with infinispan. Everybody knows that when you
open a stream, the best way to reclaim scarce resources is to close it in a
'finally' statement. What about applying it to infinispan locking mechanism
? ;-)
Calls to acquireLock should be guarded by a finally {releaseLock} (at least
to catch an interruptedException)
It looks very easy to implement, but since releaseLock does not seems to be
called every time in the code, I need help !
The only places where aquireLock is called are
CacheLoaderInterceptor.loadIfNeeded and
EntryFactoryImpl.wrapEntryForWriting.
And BTW, the locks never expire ... so if you interrupt a thread and the
lock is not released, you better say bye bye to the cache entry!
Cheers,
Phil