shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Les Hazlewood (JIRA)" <>
Subject [jira] [Resolved] (SHIRO-379) SimpleAccoutRealm concurrency access to roles and users
Date Sat, 04 May 2013 22:20:15 GMT


Les Hazlewood resolved SHIRO-379.

       Resolution: Fixed
    Fix Version/s: 1.3.0

Patch applied, but I changed the code a bit to use more efficient ReentrantReadWriteLocks.
 Please give it a look and see if it works.  All of the tests still pass.

Thanks very much for the excellent tests - they helped a *lot*!
> SimpleAccoutRealm concurrency access to roles and users
> -------------------------------------------------------
>                 Key: SHIRO-379
>                 URL:
>             Project: Shiro
>          Issue Type: Bug
>          Components: Realms 
>    Affects Versions: 1.2.0
>         Environment: Apache Tomcat 6.0.35, Win 7 x64, JDK 1.6.0_32 x64
>            Reporter: Ludovic Garcia
>            Priority: Minor
>             Fix For: 1.2.2, 1.3.0
>         Attachments: shiro_379.diff
> I'm using a PropertiesRealm which automatically reload Users and roles if the resource
has been modified.
> And i noticed that authenticating an user and reloading properties file in the same time,
authenticating do not wait for reloading to be finished. 
> Should not SimpleAccountRealm be refactored in order to lock authentication while modifying
users / roles?
> We should simply acquire a Mutex in order to retrieve users / roles or adding / removing
> An other way to ensure concurrency should be to use Collections.synchronizedMap() for
users' map and roles' map, but while reloading resource, authentications won't wait for the
reloading to be finished.
> I can do required changes if it helps 

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message