@@ -49,11 +49,20 @@ class GlobalCache(object):
4949 Attributes:
5050 strict_read (bool): If :data:`False`, transient errors that occur as part of a
5151 entity lookup operation will be logged as warnings but not raised to the
52- application layer.
52+ application layer. If :data:`True`, in the event of transient errors, cache
53+ operations will be retried a number of times before eventually raising the
54+ transient error to the application layer, if it does not resolve after
55+ retrying. Setting this to :data:`True` will cause NDB operations to take
56+ longer to complete if there are transient errors in the cache layer.
5357 strict_write (bool): If :data:`False`, transient errors that occur as part of
5458 a put or delete operation will be logged as warnings, but not raised to the
55- application layer. Setting this to :data:`True` somewhat increases the risk
56- that other clients might read stale data from the cache.
59+ application layer. If :data:`True`, in the event of transient errors, cache
60+ operations will be retried a number of times before eventually raising the
61+ transient error to the application layer if it does not resolve after
62+ retrying. Setting this to :data:`False` somewhat increases the risk
63+ that other clients might read stale data from the cache. Setting this to
64+ :data:`True` will cause NDB operations to take longer to complete if there
65+ are transient errors in the cache layer.
5766 """
5867
5968 __metaclass__ = abc .ABCMeta
@@ -243,8 +252,12 @@ class RedisCache(GlobalCache):
243252 strict_read (bool): If :data:`False`, connection errors during read operations
244253 will be logged with a warning and treated as cache misses, but will not
245254 raise an exception in the application, with connection errors during reads
246- being treated as cache misses. If :data:`True`, connection errors will be
247- raised as exceptions in the application. Default: :data:`False`.
255+ being treated as cache misses. If :data:`True`, in the event of connection
256+ errors, cache operations will be retried a number of times before eventually
257+ raising the connection error to the application layer, if it does not
258+ resolve after retrying. Setting this to :data:`True` will cause NDB
259+ operations to take longer to complete if there are transient errors in the
260+ cache layer. Default: :data:`False`.
248261 strict_write (bool): If :data:`False`, connection errors during write
249262 operations will be logged with a warning, but will not raise an exception in
250263 the application. If :data:`True`, connection errors during write will be
@@ -253,7 +266,12 @@ class RedisCache(GlobalCache):
253266 retrieve stale data from the cache. If there is a connection error, an
254267 internal flag will be set to clear the cache the next time any method is
255268 called on this object, to try and minimize the opportunity for clients to
256- read stale data from the cache. Default: :data:`True`.
269+ read stale data from the cache. If :data:`True`, in the event of connection
270+ errors, cache operations will be retried a number of times before eventually
271+ raising the connection error to the application layer, if it does not
272+ resolve after retrying. Setting this to :data:`True` will cause NDB
273+ operations to take longer to complete if there are transient errors in the
274+ cache layer. Default: :data:`True`.
257275 """
258276
259277 transient_errors = (
@@ -274,9 +292,12 @@ def from_environment(cls, strict_read=False, strict_write=True):
274292 strict_read (bool): If :data:`False`, connection errors during read
275293 operations will be logged with a warning and treated as cache misses,
276294 but will not raise an exception in the application, with connection
277- errors during reads being treated as cache misses. If :data:`True`,
278- connection errors will be raised as exceptions in the application.
279- Default: :data:`False`.
295+ errors during reads being treated as cache misses. If :data:`True`, in
296+ the event of connection errors, cache operations will be retried a
297+ number of times before eventually raising the connection error to the
298+ application layer, if it does not resolve after retrying. Setting this
299+ to :data:`True` will cause NDB operations to take longer to complete if
300+ there are transient errors in the cache layer. Default: :data:`False`.
280301 strict_write (bool): If :data:`False`, connection errors during write
281302 operations will be logged with a warning, but will not raise an
282303 exception in the application. If :data:`True`, connection errors during
@@ -285,7 +306,12 @@ def from_environment(cls, strict_read=False, strict_write=True):
285306 allow other clients to retrieve stale data from the cache. If there is
286307 a connection error, an internal flag will be set to clear the cache the
287308 next time any method is called on this object, to try and minimize the
288- opportunity for clients to read stale data from the cache. Default:
309+ opportunity for clients to read stale data from the cache. If
310+ :data:`True`, in the event of connection errors, cache operations will
311+ be retried a number of times before eventually raising the connection
312+ error to the application layer, if it does not resolve after retrying.
313+ Setting this to :data:`True` will cause NDB operations to take longer to
314+ complete if there are transient errors in the cache layer. Default:
289315 :data:`True`.
290316
291317 Returns:
@@ -398,20 +424,30 @@ class MemcacheCache(GlobalCache):
398424
399425 Args:
400426 client (pymemcache.Client): Instance of Memcache client to use.
401- strict_read (bool): If :data:`False`, connection errors during read operations
402- will be logged with a warning and treated as cache misses, but will not
403- raise an exception in the application, with connection errors during reads
404- being treated as cache misses. If :data:`True`, connection errors will be
405- raised as exceptions in the application. Default: :data:`False`.
427+ strict_read (bool): If :data:`False`, connection errors during read
428+ operations will be logged with a warning and treated as cache misses,
429+ but will not raise an exception in the application, with connection
430+ errors during reads being treated as cache misses. If :data:`True`, in
431+ the event of connection errors, cache operations will be retried a
432+ number of times before eventually raising the connection error to the
433+ application layer, if it does not resolve after retrying. Setting this
434+ to :data:`True` will cause NDB operations to take longer to complete if
435+ there are transient errors in the cache layer. Default: :data:`False`.
406436 strict_write (bool): If :data:`False`, connection errors during write
407- operations will be logged with a warning, but will not raise an exception in
408- the application. If :data:`True`, connection errors during write will be
409- raised as exceptions in the application. Because write operations involve
410- cache invalidation, setting this to :data:`False` may allow other clients to
411- retrieve stale data from the cache. If there is a connection error, an
412- internal flag will be set to clear the cache the next time any method is
413- called on this object, to try and minimize the opportunity for clients to
414- read stale data from the cache. Default: :data:`True`.
437+ operations will be logged with a warning, but will not raise an
438+ exception in the application. If :data:`True`, connection errors during
439+ write will be raised as exceptions in the application. Because write
440+ operations involve cache invalidation, setting this to :data:`False` may
441+ allow other clients to retrieve stale data from the cache. If there is
442+ a connection error, an internal flag will be set to clear the cache the
443+ next time any method is called on this object, to try and minimize the
444+ opportunity for clients to read stale data from the cache. If
445+ :data:`True`, in the event of connection errors, cache operations will
446+ be retried a number of times before eventually raising the connection
447+ error to the application layer, if it does not resolve after retrying.
448+ Setting this to :data:`True` will cause NDB operations to take longer to
449+ complete if there are transient errors in the cache layer. Default:
450+ :data:`True`.
415451 """
416452
417453 transient_errors = (
@@ -458,9 +494,12 @@ def from_environment(cls, max_pool_size=4, strict_read=False, strict_write=True)
458494 strict_read (bool): If :data:`False`, connection errors during read
459495 operations will be logged with a warning and treated as cache misses,
460496 but will not raise an exception in the application, with connection
461- errors during reads being treated as cache misses. If :data:`True`,
462- connection errors will be raised as exceptions in the application.
463- Default: :data:`False`.
497+ errors during reads being treated as cache misses. If :data:`True`, in
498+ the event of connection errors, cache operations will be retried a
499+ number of times before eventually raising the connection error to the
500+ application layer, if it does not resolve after retrying. Setting this
501+ to :data:`True` will cause NDB operations to take longer to complete if
502+ there are transient errors in the cache layer. Default: :data:`False`.
464503 strict_write (bool): If :data:`False`, connection errors during write
465504 operations will be logged with a warning, but will not raise an
466505 exception in the application. If :data:`True`, connection errors during
@@ -469,7 +508,12 @@ def from_environment(cls, max_pool_size=4, strict_read=False, strict_write=True)
469508 allow other clients to retrieve stale data from the cache. If there is
470509 a connection error, an internal flag will be set to clear the cache the
471510 next time any method is called on this object, to try and minimize the
472- opportunity for clients to read stale data from the cache. Default:
511+ opportunity for clients to read stale data from the cache. If
512+ :data:`True`, in the event of connection errors, cache operations will
513+ be retried a number of times before eventually raising the connection
514+ error to the application layer, if it does not resolve after retrying.
515+ Setting this to :data:`True` will cause NDB operations to take longer to
516+ complete if there are transient errors in the cache layer. Default:
473517 :data:`True`.
474518
475519 Returns:
0 commit comments