[jboss-jira] [JBoss JIRA] Commented: (JBCACHE-794) Eviction Queue hard limit can cause deadlocks

Manik Surtani (JIRA) jira-events at jboss.com
Wed Oct 11 12:30:41 EDT 2006


    [ http://jira.jboss.com/jira/browse/JBCACHE-794?page=comments#action_12345074 ] 
            
Manik Surtani commented on JBCACHE-794:
---------------------------------------

Playing around with unit tests for this; I don't see any timeout exceptions or deadlocks as you suggest but I do see the main thread (or any writer thread for that matter) blocking until the eviction thread can start to clear stuff up.

I can see how this is a problem, particularly if the eviction thread does get a timeout exception, as it then puts the eviction request *back* on the queue.  This should not happen since the node obviously should no longer be evicted.

Looking at the test some more, trying to recreate the deadlock scenario you speak of.

> Eviction Queue hard limit can cause deadlocks
> ---------------------------------------------
>
>                 Key: JBCACHE-794
>                 URL: http://jira.jboss.com/jira/browse/JBCACHE-794
>             Project: JBoss Cache
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 1.4.0.SP1
>            Reporter: Owen Taylor
>         Assigned To: Manik Surtani
>             Fix For: 2.0.0, 1.4.0.SP2
>
>
> if the eviction queue fills up, you can get the situation where:
>  - The eviction queue processing task calls evict() which needs to get a write lock on a node
>  - A different thread has a read lock on that node and is blocking to put something into the eviction queue
> Once this starts happening the evication queue thread is procesing events *very* slowly because
> it repeatedly stalls while the lock times out, so the queue will stay full.
> Without digging into the code too much, possible fixes that occur to me include:
>  1) Don't have a hard limit on the size of the eviction queue, and just warn when it gets too big
>  2) Use a timeout of 0 when trying to get the write lock to evict a node, after all, if a node is
>       locked when we try to evict it, it probably shouldn't be evicted anyways.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list