[SERVER-12091] Changing userCacheInvalidationIntervalSecs with setParameter doesn't take effect until the current interval finishes Created: 13/Dec/13  Updated: 11/Nov/14  Resolved: 20/Oct/14

Status: Closed
Project: Core Server
Component/s: Security, Sharding, Usability
Affects Version/s: 2.5.4
Fix Version/s: 2.7.8

Type: Bug Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to DOCS-3453 2.8 - change to userCacheInvalidation... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 20/Oct/14 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-12091 Make changes to userCacheInvalidationIntervalSecs take place immediately
Branch: master
https://github.com/mongodb/mongo/commit/122d57ae22b8bc3544fce3e83c55f9eea1cbf7ab

Generated at Thu Feb 08 03:27:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.