Issue #8444 has been reported by Josh Cooper.

----------------------------------------
Bug #8444: Cacher not robust enough on Windows
https://projects.puppetlabs.com/issues/8444

Author: Josh Cooper
Status: Unreviewed
Priority: Normal
Assignee: 
Category: 
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