Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-8714

Bug related to caching used to improve role service performance.

    Details

    • Type: Bug Fix Bug Fix
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.3
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-11177Need JPA related caching functionality to improve performance and support clustering
      KULRICE-7632Improve exception handling in RoleServiceImpl#principalHasRole related to role type services
      KULRICE-8327Implement caching for Message Service
      KULRICE-8273Add caching to style service to improve EDocLite performance
      KULRICE-8448Improve Role Performance
      KULRICE-5100StyleServiceImpl.getStyle should perform caching of styles
      KULRICE-12341Performance issues opening large roles
      KULRICE-8250Improve EDocLite Performance
      KULRICE-3689Improve performance of IdentityArchiveService interactions
      KULRICE-2315Implement caching of data to the IdentityManagementService implementation
    • Rice Module:
      KIM
    • Application Requirement:
      KC
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      In KC, we are noticing that after our recent rice upgrade to Rice 2.1.3 revision 36332, some documents like PropDev become uneditable after the first save. This is because of the changes made for KULRICE-8448. I have verified that this is related to caching of roles by disabling ehcache in my local environment. On researching this issue a bit, I noticed that the getPrincipalHasRoleFromCache in RoleServiceImpl returns false after the first save when ehcache is turned on. This results in hasRole being false in RoleServiceImpl line 1149. This causes the roles list to be empty and false is returned from the getPrincipalHasRole method. Not sure why the value from cache is "false" to begin with though, perhaps it is not being initialized correctly? I temporarily fixed this in KC by overriding the roleServiceImpl and making the getPrincipalHasRoleFromCache method return null so the value from cache is never used.

        Activity

        Hide
        Shannon Hess added a comment -

        There's a bug with the flushing! I'll get this fixed locally and tested. I'll post more details after I'm sure this fixes the problem.

        Thanks for all the help!

        Shannon

        Show
        Shannon Hess added a comment - There's a bug with the flushing! I'll get this fixed locally and tested. I'll post more details after I'm sure this fixes the problem. Thanks for all the help! Shannon
        Hide
        Gayathri Athreya added a comment -

        Makes sense. I tried various things before resorting to override the KimRoleTypeService, one of them being flushing the cache before checking permissions and that did not work. Sorry for not telling you that, would have saved us a lot of trouble.

        Show
        Gayathri Athreya added a comment - Makes sense. I tried various things before resorting to override the KimRoleTypeService, one of them being flushing the cache before checking permissions and that did not work. Sorry for not telling you that, would have saved us a lot of trouble.
        Hide
        Shannon Hess added a comment -

        No problem, it's all working now. On the role service, several of the methods including assignPrincipalToRole did not have a cache evict statement for the Role.Cache.NAME so that's why the cache wasn't getting cleared when that method was called. I pulled in the updated rice jars locally and the problem is no longer happening.

        Thanks so much for all the help on this issue!

        Shannon

        Show
        Shannon Hess added a comment - No problem, it's all working now. On the role service, several of the methods including assignPrincipalToRole did not have a cache evict statement for the Role.Cache.NAME so that's why the cache wasn't getting cleared when that method was called. I pulled in the updated rice jars locally and the problem is no longer happening. Thanks so much for all the help on this issue! Shannon
        Hide
        Gayathri Athreya added a comment -

        Awesome, thanks!

        Show
        Gayathri Athreya added a comment - Awesome, thanks!
        Hide
        Gayathri Athreya added a comment -

        Confirmed fixed.

        Show
        Gayathri Athreya added a comment - Confirmed fixed.

          People

          • Assignee:
            Shannon Hess
            Reporter:
            Gayathri Athreya
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Structure Helper Panel