syncope-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitriy B. (JIRA)" <>
Subject [jira] [Issue Comment Deleted] (SYNCOPE-1386) Not committed managed objects can get into L2 cache.
Date Tue, 23 Oct 2018 16:05:00 GMT


Dmitriy B. updated SYNCOPE-1386:
    Comment: was deleted

(was: In code [] I
also noticed that `entityManager().remove(merged);` is called. 
What is the purpose why you do this? The transaction is rolled back and changes are not added
into database (even remove(merged) action doesn't work). 
Maybe you need to detach the managed entity and also remove it from the L2 cache if it is
if (entityManager().getEntityManagerFactory().getCache() != null) { 
entityManager().getEntityManagerFactory().getCache().evict(JPAUser.class, merged.getKey()); 
Maybe you have other similar places in the code like above? )

> Not committed managed objects can get into L2 cache.
> ----------------------------------------------------
>                 Key: SYNCOPE-1386
>                 URL:
>             Project: Syncope
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.0.8
>            Reporter: Dmitriy B.
>            Priority: Major
>         Attachments:
> Hi guys. I noticed the issue that leads to inconsistent data that comes in response. 
> Here is the use-case how to reproduce the problem: 
> 1. Create user in Syncope 
> 2. Do a request password reset action and make sure that token that is used for pwd reset
action is generated and stored into database. 
> 3. Restart your application to be sure that L2 cache is empty. 
> 4. Confirm password reset action for this user and make sure that requested password
doesn't apply the password rules. In my case password is too short. The exception like "InvalidUser:InvalidPassword:
Password too short" should be thrown. 
> 5. Request the user by username. The user that comes in HTTP Response doesn't have "token"
and "tokenExpireTime" attributes. But you may find "token" and "tokenExpireTime" value in
SyncopeUser table for this user. 
> I also noticed that ~ after 5 minutes left the L2 cache is gone.
> You can find an example in script. Run this command to execute
the script: 
> "./ | tee temp.log" 
> Here I'm trying to do confirm-password-reset action after 5 minutes of waiting with the
password that doesn't match the rules. And then I'm requesting user by username. In response
it comes without "token" and "tokenExpireTime".

This message was sent by Atlassian JIRA

View raw message