You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by "Guillaume Leger (JIRA)" <ji...@apache.org> on 2015/09/30 00:44:04 UTC

[jira] [Updated] (SHIRO-544) WeakHashMap 100% CPU utilisation in ShiroModule

     [ https://issues.apache.org/jira/browse/SHIRO-544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Leger updated SHIRO-544:
----------------------------------
    Description: 
_ShiroModule_'s destroyables member variable is backed by an unsynchronized WeakHashMap, which can cause endless loops. 

See: 

https://java.net/jira/browse/JAVASERVERFACES-2544
https://bugs.eclipse.org/bugs/show_bug.cgi?id=397439

This means that the _add(Destroyable)_ method can cause deadlock. 

This issue is hard to workaround because the _destroy()_ method is final so we cannot simply override the behavior. 

We were able to fix this problem by making both the _add()_ and _destroy()_ methods synchronized after forking the project. 

  was:
`ShiroModule`'s destroyables member variable is backed by an unsynchronized WeakHashMap, which can cause endless loops. 

See: 

https://java.net/jira/browse/JAVASERVERFACES-2544
https://bugs.eclipse.org/bugs/show_bug.cgi?id=397439

This means that the `add(Destroyable)` method can cause deadlock. 

This issue is hard to workaround because the `destroy()` method is final so we cannot simply override the behavior. 

We were able to fix this problem by making both the add() and destroy() methods synchronized after forking the project. 


> WeakHashMap 100% CPU utilisation in ShiroModule
> -----------------------------------------------
>
>                 Key: SHIRO-544
>                 URL: https://issues.apache.org/jira/browse/SHIRO-544
>             Project: Shiro
>          Issue Type: Bug
>          Components: Integration: Guice
>    Affects Versions: 1.2.4
>            Reporter: Guillaume Leger
>            Assignee: Jared Bunting
>
> _ShiroModule_'s destroyables member variable is backed by an unsynchronized WeakHashMap, which can cause endless loops. 
> See: 
> https://java.net/jira/browse/JAVASERVERFACES-2544
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=397439
> This means that the _add(Destroyable)_ method can cause deadlock. 
> This issue is hard to workaround because the _destroy()_ method is final so we cannot simply override the behavior. 
> We were able to fix this problem by making both the _add()_ and _destroy()_ methods synchronized after forking the project. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)