Issue #8444 has been updated by Nick Lewis.

Status changed from Accepted to Merged - Pending Release

A 'fix' for this has been merged to master in 
commit:c5d70ed11f8f964523ca049d6c3d504de3840c1a.

The change entailed removing the use of cacher almost everywhere it's used, and 
modifying it to use only TTL-based expiration for the remaining two uses.

However, because the last two attributes it's used for are actually invalidated 
by a particular configuration change, we can probably implement something 
simpler and more robust for expiring them when their settings change, rather 
than based on time.
----------------------------------------
Bug #8444: Cacher not robust enough on Windows
https://projects.puppetlabs.com/issues/8444

Author: Josh Cooper
Status: Merged - Pending Release
Priority: Normal
Assignee: 
Category: windows
Target version: Telly
Affected Puppet version: 
Keywords: 
Branch: 


Time.now on Windows has a lower resolution on Unix. As a result, two problems 
can occur with Puppet::Util::Cacher

1. If an entry is expired and accessed soon after (within a second), the entry 
will not be treated as being expired, because the @cache_timestamp is not 
strictly less than the expiration timeout (the values will be equal).
1. If an entry is expired (time A) and soon after accessed twice (time B and 
C), and A, B, C are within one second, then the entry at time B will be 
considered expired and so at time C the cache will be cleared again and the 
value initialized an extra time.

There are also some general issues that need further investigation:

1. The cache_timestamp is only updated when an entry is initially added or 
deleted, but not when it is updated. This doesn't seem correct, but more 
investigation is needed to see if that is semantically the correct behavior. 
See Cacher.cache_timestamp 
1. expired_by_expirer? accesses self.class.attr_ttl without first checking that 
it responds to that method. However, expired_by_ttl? which is called later, 
does check.
1. If a single entry is expired_by_expirer?, then the entire value_cache is 
cleared and the cache timestamp updated, but if the entry is expired by its 
ttl, then only that entry is deleted from the cache, but the cache_timestamp is 
not updated.




-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to