Changelog¶
0.9.0¶
Released: Mon Oct 28 2019feature¶
[feature]
Added logging facililities into
¶CacheRegion
, to indicate key events such as cache keys missing or regeneration of values. As these can be very high volume log messages,logging.DEBUG
is used as the log level for the events. Pull request courtesy Stéphane Brunner.
0.8.0¶
Released: Fri Sep 20 2019bug¶
[bug] [setup]
Removed the “python setup.py test” feature in favor of a straight run of “tox”. Per Pypa / pytest developers, “setup.py” commands are in general headed towards deprecation in favor of tox. The tox.ini script has been updated such that running “tox” with no arguments will perform a single run of the test suite against the default installed Python interpreter.
¶References: #157
[bug] [py3k]
Replaced the Python compatbility routines for
¶getfullargspec()
with a fully vendored version from Python 3.3. Originally, Python was emitting deprecation warnings for this function in Python 3.8 alphas. While this change was reverted, it was observed that Python 3 implementations forgetfullargspec()
are an order of magnitude slower as of the 3.4 series where it was rewritten againstSignature
. While Python plans to improve upon this situation, SQLAlchemy projects for now are using a simple replacement to avoid any future issues.References: #154
[bug] [installation]
Pinned minimum version of Python decorator module at 4.0.0 (July, 2015) as previous versions don’t provide the API that dogpile is using.
¶References: #160
[bug] [py3k]
Fixed the
¶sha1_mangle_key()
key mangler to coerce incoming Unicode objects into bytes as is required by the Py3k version of this function.References: #159
0.7.1¶
Released: Tue Dec 11 2018bug¶
[bug] [region]
Fixed regression in 0.7.0 caused by #136 where the assumed arguments for the
¶CacheRegion.async_creation_runner
expanded to include the newCacheRegion.get_or_create.creator_args
parameter, as it was not tested that the async runner would be implicitly called with these arguments when theCacheRegion.cache_on_arguments()
decorator was used. The exact signature ofasync_creation_runner
is now restored to have the same arguments in all cases.References: #139
0.7.0¶
Released: Mon Dec 10 2018bug¶
[bug]
The
decorator
module is now used when creating function decorators withinCacheRegion.cache_on_arguments()
andCacheRegion.cache_multi_on_arguments()
so that function signatures are preserved. Pull request courtesy ankitpatel96.Additionally adds a small performance enhancement which is to avoid internally creating a
¶@wraps()
decorator for the creator function on every get operation, by allowing the arguments to the creator be passed separately toCacheRegion.get_or_create()
.References: #137
[bug] [py3k]
Fixed all Python 3.x deprecation warnings including
¶inspect.getargspec()
.References: #129
0.6.8¶
Released: Sat Nov 24 2018[change]
Project hosting has moved to GitHub, under the SQLAlchemy organization at https://github.com/sqlalchemy/dogpile.cache
¶
0.6.7¶
Released: Thu Jul 26 2018bug¶
[bug]
Fixed issue in the
¶CacheRegion.get_or_create_multi()
method which was erroneously considering the cached value as the timestamp field if theCacheRegion.invalidate()
method had ben used, usually causing aTypeError
to occur, or in less frequent cases an invalid result for whether or not the cached value was invalid, leading to excessive caching or regeneration. The issue was a regression caused by an implementation issue in the pluggable invalidation feature added in #38.References: #128
0.6.6¶
Released: Wed Jun 27 2018feature¶
[feature]
Added method
¶CacheRegion.actual_backend
which calculates and caches the actual backend for the region, which may be abstracted by the use of one or moreProxyBackend
subclasses.References: #123
0.6.5¶
Released: Mon Mar 5 20180.6.4¶
Released: Mon Jun 26, 2017bug¶
[bug]
The method
¶Region.get_or_create_multi()
will not pass to the cache backend if no values are ultimately to be stored, based on the use of theRegion.get_or_create_multi.should_cache_fn
function. This empty dictionary is unnecessary and can cause API problems for backends like that of Redis. Pull request courtesy Tobias Sauerwein.[bug]
The
¶api.NO_VALUE
constant now has a fixed__repr__()
output, so that scenarios where this constant’s string value ends up being used as a cache key do not create multiple values. Pull request courtesy Paul Brown.[bug]
A new exception class
¶exception.PluginNotFound
is now raised when a particular cache plugin class cannot be located either as a setuptools entrypoint or as a registered backend. Previously, a plainException
was thrown. Pull request courtesy Jamie Lennox.
0.6.3¶
Released: Thu May 18, 2017feature¶
[feature]
Added
¶replace_existing_backend
toCacheRegion.configure_from_config()
. Pull request courtesy Daniel Kraus.
0.6.2¶
Released: Tue Aug 16 2016feature¶
[feature]
Added a new system to allow custom plugins specific to the issue of “invalidate the entire region”, using a new base class
¶RegionInvalidationStrategy
. As there are many potential strategies to this (special backend function, storing special keys, etc.) the mechanism for both soft and hard invalidation is now customizable. New approaches to region invalidation can be contributed as documented recipes. Pull request courtesy Alexander Makarov.References: #38
[feature]
Added a new cache key generator
¶kwarg_function_key_generator()
, which takes keyword arguments as well as positional arguments into account when forming the cache key.References: #43
bug¶
[bug]
Restored some more util symbols that users may have been relying upon (although these were not necessarily intended as user-facing):
¶dogpile.cache.util.coerce_string_conf
,dogpile.cache.util.KeyReentrantMutex
,dogpile.cache.util.memoized_property
,dogpile.cache.util.PluginLoader
,dogpile.cache.util.to_list
.
0.6.1¶
Released: Mon Jun 6 20160.6.0¶
Released: Mon Jun 6 2016feature¶
[feature]
The
dogpile.core
library has been rolled in as part of thedogpile.cache
distribution. The configuration of thedogpile
name as a namespace package is also removed fromdogpile.cache
. In order to allow existing installations ofdogpile.core
as a separate package to remain unaffected, the.core
package has been retired withindogpile.cache
directly; theLock
class is now available directly asdogpile.Lock
and the additionaldogpile.core
constructs are under thedogpile.util
namespace.Additionally, the long-deprecated
¶dogpile.core.Dogpile
anddogpile.core.SyncReaderDogpile
classes have been removed.References: #91
bug¶
[bug]
The Redis backend now creates a copy of the “arguments” dictionary passed to it, before popping values out of it. This prevents the given dictionary from losing its keys.
¶[bug]
Fixed bug in “null” backend where
¶NullLock
did not accept a flag for theNullLock.acquire()
method, nor did it return a boolean value for “success”.References: #97
0.5.7¶
Released: Mon Oct 19 2015feature¶
[feature]
Added new parameter
¶GenericMemcachedBackend.lock_timeout
, used in conjunction withGenericMemcachedBackend.distributed_lock
, will specify the timeout used when communicating to the.add()
method of the memcached client. Pull request courtesy Frits Stegmann and Morgan Fainberg.References: #54, pull request 37
[feature]
Added a new flag
¶CacheRegion.configure.replace_existing_backend
, allows a region to have a new backend replace an existing one. Pull request courtesy hbccbh.References: #65, pull request 35
[feature] [tests]
Test suite now runs using py.test. Pull request courtesy John Anderson.
¶References: pull request 33
bug¶
[bug] [redis]
Repaired the
¶CacheRegion.get_multi()
method when used with a list of zero length against the redis backend.References: #74
0.5.6¶
Released: Mon Feb 2 2015feature¶
[feature]
Changed the pickle protocol for the file/DBM backend to
¶pickle.HIGHEST_PROTOCOL
when producing new pickles, to match that of the redis and memorypickle backends. Pull request courtesy anentropic.References: pull request 30
0.5.5¶
Released: Wed Jan 21 2015feature¶
[feature]
Added new arguments
¶CacheRegion.cache_on_arguments.function_key_generator
andCacheRegion.cache_multi_on_arguments.function_multi_key_generator
which serve as per-decorator replacements for the region-wideCacheRegion.function_key_generator
andCacheRegion.function_multi_key_generator
parameters, respectively, so that custom key production schemes can be applied on a per-function basis within one region. Pull request courtesy Hongbin Lu.References: pull request 26
bug¶
[bug]
Fixed bug where sending -1 for the
¶CacheRegion.get_or_create.expiration_time
parameter toCacheRegion.get_or_create()
orCacheRegion.get_or_create_multi()
would fail to honor the setting as “no expiration time”. Pull request courtesy Hongbin Lu.References: #71, pull request 25
[bug]
The
¶wrap
argument is now propagated when callingCacheRegion.configure_from_config()
. Pull request courtesy Jonathan Vanasco.References: #41, pull request 28
[bug]
Fixed tests under py.test, which were importing a symbol from pytest itself
¶is_unittest
which has been removed.
0.5.4¶
Released: Sat Jun 14 2014feature¶
[feature]
Added new
¶NullBackend
, for testing and cache-disabling purposes. Pull request courtesy Wichert Akkerman.References: pull request 18
[feature]
Added new
¶RedisBackend.connection_pool
option on the Redis backend; this can be passed aredis.ConnectionPool
instance directly. Pull request courtesy Masayuko.References: pull request 17
[feature]
Added new
¶RedisBackend.socket_timeout
option on the Redis backend. Pull request courtesy Saulius Menkevičius.References: pull request 16
[feature]
Added support for tests to run via py.test.
¶
bug¶
[bug]
Added missing Mako test dependency to setup.py. Pull request courtesy Wichert Akkerman.
¶References: pull request 19
[bug]
Fixed bug where calling
¶CacheRegion.get_multi()
orCacheRegion.set_multi()
with an empty list would cause failures based on backend. Pull request courtesy Wichert Akkerman.References: #58, pull request 20
[bug]
Repaired the entry point for Mako templates; the name of the entrypoint itself was wrong vs. what was in the docs, but beyond that the entrypoint would load the wrong module name. Pull request courtesy zoomorph.
¶References: pull request 15
[bug]
The
¶coerce_string_conf()
function, which is used byRegion.configure_from_config()
, will now recognize floating point values when parsing conf strings and deliver them as such; this supports non-integer values such as Redislock_sleep
. Pullreq courtesy Jeff Dairiki.References: #57, pull request 13
0.5.3¶
Released: Wed Jan 8 2014feature¶
[feature]
Added a
¶get()
method to complement theset()
,invalidate()
andrefresh()
methods established on functions decorated byCacheRegion.cache_on_arguments()
andCacheRegion.cache_multi_on_arguments()
. Pullreq courtesy Eric Hanchrow.References: #55
[feature]
Added a new variant on
¶MemoryBackend
,MemoryPickleBackend
. This backend appliespickle.dumps()
andpickle.loads()
to cached values upon set and get, so that similar copy-on-cache behavior as that of other backends is employed, guarding cached values against subsequent in-memory state changes. Pullreq courtesy Jonathan Vanasco.References: #51, pull request 11
bug¶
[bug]
Fixed bug where the key_mangler would get in the way of usage of the async_creation_runner feature within the
¶Region.get_or_create()
method, by sending in the mangled key instead of the original key. The “mangled” key is only supposed to be exposed within the backend storage, not the creation function which sends the key back into theRegion.set()
, which does the mangling itself. Pull request courtesy Ryan Kolak.References: pull request 10
[bug] [py3k]
Fixed bug where the
¶Region.get_multi()
method wasn’t calling the backend correctly in Py3K (e.g. was passing a destructivemap()
object) which would cause this method to fail on the memcached backend.[bug]
Fixed a format call in the redis backend which would otherwise fail on Python 2.6; courtesy Jeff Dairiki.
¶References: pull request 9
0.5.2¶
Released: Fri Nov 15 2013feature¶
[feature]
Added a new argument
¶lock_factory
to theDBMBackend
implementation. This allows for drop-in replacement of the defaultFileLock
backend, which builds onos.flock()
and only supports Unix platforms. A new abstract baseAbstractFileLock
has been added to provide a common base for custom lock implementations. The documentation points to an example thread-based rw lock which is now tested on Windows.References: #44
0.5.1¶
Released: Thu Oct 10 2013feature¶
[feature]
The
¶CacheRegion.invalidate()
method now supports an optionhard=True|False
. A “hard” invalidation, equivalent to the existing functionality ofCacheRegion.invalidate()
, meansCacheRegion.get_or_create()
will not return the “old” value at all, forcing all getters to regenerate or wait for a regeneration. “soft” invalidation means that getters can continue to return the old value until a new one is generated.References: #38
[feature]
New dogpile-specific exception classes have been added, so that issues like “region already configured”, “region unconfigured”, raise dogpile-specific exceptions. Other exception classes have been made more specific. Also added new accessor
¶CacheRegion.is_configured
. Pullreq courtesy Morgan Fainberg.References: #40
bug¶
[bug]
Erroneously missed when the same change was made for
¶set()
in 0.5.0, the Redis backend now usespickle.HIGHEST_PROTOCOL
for theset_multi()
method as well when producing pickles. Courtesy Łukasz Fidosz.[bug] [py3k] [redis]
Fixed an errant
¶u''
causing incompatibility in Python3.2 in the Redis backend, courtesy Jimmey Mabey.References: #39
[bug]
The
¶util.coerce_string_conf()
method now correctly coerces negative integers and those with a leading + sign. This previously prevented configuring aCacheRegion
with anexpiration_time
of'-1'
. Courtesy David Beitey.[bug]
The
¶refresh()
method onCacheRegion.cache_multi_on_arguments()
now supports theasdict
flag.
0.5.0¶
Released: Fri Jun 21 2013feature¶
[feature]
Now using the
¶Lock
included with the Pythonredis
backend, which addslock_timeout
andlock_sleep
arguments to theRedisBackend
.[feature]
Added new methods
¶CacheRegion.get_or_create_multi()
andCacheRegion.cache_multi_on_arguments()
, which make use of theCacheRegion.get_multi()
and similar functions to store and retrieve multiple keys at once while maintaining dogpile semantics for each.[feature]
Added a method
¶refresh()
to functions decorated byCacheRegion.cache_on_arguments()
andCacheRegion.cache_multi_on_arguments()
, to complementinvalidate()
andset()
.References: #36
[feature]
¶CacheRegion.configure()
accepts an optionaldatetime.timedelta
object for theexpiration_time
argument as well as an integer, courtesy Jack Lutz.References: #13
[feature]
The
¶expiration_time
argument passed toCacheRegion.cache_on_arguments()
may be a callable, to return a dynamic timeout value. Courtesy David Beitey.References: #20
[feature]
Added support for simple augmentation of existing backends using the
¶ProxyBackend
class. Thanks to Tim Hanus for the great effort with development, testing, and documentation.References: #26
[feature]
Full support for multivalue get/set/delete added, using
¶CacheRegion.get_multi()
,CacheRegion.set_multi()
,CacheRegion.delete_multi()
, courtesy Marcos Araujo Sobrinho.References: pull request 14
bug¶
[bug]
The Redis backend now uses
¶pickle.HIGHEST_PROTOCOL
when producing pickles. Courtesy Lx Yu.[bug]
¶CacheRegion.cache_on_arguments()
now has a new argumentto_str
, defaults tostr()
. Can be replaced withunicode()
or other functions to support caching of functions that accept non-unicode arguments. Initial patch courtesy Lx Yu.[bug]
Fixed bug where the “name” parameter for
¶CacheRegion
was ignored entirely. Courtesy Wichert Akkerman.References: #27
0.4.3¶
Released: Thu Apr 4 2013feature¶
[feature]
¶CacheRegion.get_or_create()
andCacheRegion.cache_on_arguments()
now accept a new argumentshould_cache_fn
, receives the value returned by the “creator” and then returns True or False, where True means “cache plus return”, False means “return the value but don’t cache it.”References: pull request 13
bug¶
[bug]
Added support for the
¶cache_timeout
Mako argument to the Mako plugin, which will pass the value to theexpiration_time
argument ofCacheRegion.get_or_create()
.
0.4.2¶
Released: Sat Jan 19 2013feature¶
[feature]
An “async creator” function can be specified to
¶CacheRegion
which allows the “creation” function to be called asynchronously or be subsituted for another asynchronous creation scheme. Courtesy Ralph Bean.References: pull request 10
0.4.1¶
Released: Sat Dec 15 2012feature¶
[feature]
The function decorated by
¶CacheRegion.cache_on_arguments()
now includes aset()
method, in addition to the existinginvalidate()
method. Likeinvalidate()
, it accepts a set of function arguments, but additionally accepts as the first positional argument a new value to place in the cache, to take the place of that key. Courtesy Antoine Bertin.References: pull request 9
[feature]
Redis backend now accepts optional “url” argument, will be passed to the new
¶StrictRedis.from_url()
method to determine connection info. Courtesy Jon Rosebaugh.[feature]
Redis backend now accepts optional “password” argument. Courtesy Jon Rosebaugh.
¶[feature]
DBM backend has “fallback” when calling dbm.get() to instead use dictionary access + KeyError, in the case that the “gdbm” backend is used which does not include .get(). Courtesy Jon Rosebaugh.
¶
bug¶
[bug]
Fixed bug in DBM backend whereby if an error occurred during the “write” operation, the file lock, if enabled, would not be released, thereby deadlocking the app.
¶References: #15
[bug]
The
¶util.function_key_generator()
used by the function decorator no longer coerces non-unicode arguments into a Python unicode object on Python 2.x; this causes failures on backends such as DBM which on Python 2.x apparently require bytestrings. The key_mangler is still needed if actual unicode arguments are being used by the decorated function, however.References: #12
0.4.0¶
Released: Tue Oct 30 2012bug¶
[bug]
Using dogpile.core 0.4.0 now, fixes a critical bug whereby dogpile pileup could occur on first value get across multiple processes, due to reliance upon a non-shared creation time. This is a dogpile.core issue.
¶References: #1
[bug]
Fixed missing __future__ with_statement directive in region.py.
¶
0.3.1¶
Released: Tue Sep 25 20120.3.0¶
Released: Thu Jun 14 2012feature¶
[feature]
get() method now checks expiration time by default. Use ignore_expiration=True to bypass this.
¶[feature]
Added new invalidate() method. Sets the current timestamp as a minimum value that all retrieved values must be created after. Is honored by the get_or_create() and get() methods.
¶References: #7
0.2.3¶
Released: Wed May 16 2012support “min_compress_len” and “memcached_expire_time” with python-memcached backend. Tests courtesy Justin Azoff
¶References: #3
Add support for coercion of string config values to Python objects - ints, “false”, “true”, “None”.
¶References: #4
Added support to DBM file lock to allow reentrant access per key within a single thread, so that even though the DBM backend locks for the whole file, a creation function that calls upon a different key in the cache can still proceed.
¶References: #5
Fixed DBM glitch where multiple readers could be serialized.
¶Adjust bmemcached backend to work with newly-repaired bmemcached calling API (see bmemcached ef206ed4473fec3b639e).
¶
0.2.1¶
Released: Sun Apr 15 20120.2.0¶
Released: Sat Apr 14 2012Based on dogpile.core now, to get the package namespace thing worked out.
¶