whirlycache
  1. whirlycache
  2. WHIRLYCACHE-24

Method CacheManager.shutdown() always throws ConcurrentModificationException

    Details

    • Type: Task Task
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      24

      Description

      Method CacheManager.shutdown() calls destroy(), which modifies the namedCaches
      map and causes ConcurrentModificationException. The following patch for the
      shutdown() method fixes the problem. Also the patched method does not throw any
      exceptions. This change is made because the shutdown() method is normally called
      right before exiting the application and it must do as much cleanup as possible.

      /**

      • Shuts down the manager of all of the Caches, which in turn shuts down all
        of the Caches.
      • @return <code>true</code> if shutdown was successful, <code>false</code>
        otherwise.
        */
        public boolean shutdown() {
        boolean result = true;
        synchronized (namedCaches) {
        final Iterator cacheNames = new ArrayList(namedCaches.keySet()).
        iterator();
        //Loop and shut down all the individual caches.
        while (cacheNames.hasNext())
        Unknown macro: { try { destroy((String) cacheNames.next()); } catch (CacheException e) { log.error(Messages.getString("CacheManager. problem_shutting_down"), e); //$NON-NLS-1$ result = false; } }

        }
        return result;
        }

        Activity

        Hide
        whirlycott added a comment -

        kgb___,

        First, sorry for taking a month to respond to this. I couldn't reproduce this
        problem for the longest while, but I can now. I've checked in a fix for it.

        Please retest this and close the issue.

        Show
        whirlycott added a comment - kgb___, First, sorry for taking a month to respond to this. I couldn't reproduce this problem for the longest while, but I can now. I've checked in a fix for it. Please retest this and close the issue.

          People

          • Assignee:
            kgb___
            Reporter:
            kgb___
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: