Uploaded image for project: 'Shiro'
  1. Shiro
  2. SHIRO-544

WeakHashMap 100% CPU utilisation in ShiroModule

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.4
    • Fix Version/s: None
    • Component/s: Integration: Guice
    • Labels:
      None

      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.

        Attachments

          Activity

            People

            • Assignee:
              deraj123 Jared Bunting
              Reporter:
              guillaumeleger Guillaume Leger
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: