Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12091

Changing userCacheInvalidationIntervalSecs with setParameter doesn't take effect until the current interval finishes

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.7.8
    • Affects Version/s: 2.5.4
    • Component/s: Security, Sharding, Usability
    • Labels:
      None
    • Fully Compatible
    • ALL

      By default, mongos invalidates its user cache every 10 minutes. It's possible to change this interval at runtime using the "userCacheInvalidationIntervalSecs" option to setParameter. The problem is that changing this value with setParameter doesn't wake up the invalidation thread if its already sleeping. This means that if you start up a new mongos and then immediately change its cache invalidation interval to something shorter than the 10 minute default, it is likely that the cache still won't be invalidated for almost 10 minutes, since the invalidation thread is already in the middle of a 10 minute sleep when you change the sleep interval.

      This could be fixed without too much work by changing the invalidation thread to sleep on a condition variable and by signaling that condvar whenever the "userCacheInvalidationIntervalSecs" value is changed.

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: