Uploaded image for project: 'Kuali Rice Development'
  1. Kuali Rice Development
  2. KULRICE-8714

Bug related to caching used to improve role service performance.

    Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: 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
    • 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.

        Attachments

          Activity

          Hide
          shahess 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
          shahess 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
          gathreya 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
          gathreya 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
          shahess 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
          shahess 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
          gathreya Gayathri Athreya added a comment -

          Awesome, thanks!

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

          Confirmed fixed.

          Show
          gathreya Gayathri Athreya added a comment - Confirmed fixed.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: