Using jsonschema we can validate (at a basic level)
that the files created and the contents written were
not altered to be of a different format so add some
basic format validation to help in detecting format
issues/changes.
This also avoids having to use type errors to try to
detect this same kind of tampering/data format change.
Change-Id: I80b4e560f24162e079cf4adab06d35ec75f4b70c
Start to organize this page with a more helpful structure
that will allow people to read it and figure out which driver
best fits there usage (and to help people decide which ones
don't).
Change-Id: I871d2eb7e7493a6633f7738ff063042d39690364
Instead of having one outlier lock class (file locks) which fetch
the same lock object from different coordinators have each coordinator
that is using the file driver return different locks and only share
the absolute minimum of components to ensure this is done in a safe
manner (due to lack of thread awareness in process based locks).
Change-Id: I32d22230cb0165ccfbb39b6e97f12f906836b0e1
For the greater good!
People supposedly don't read the docs or warnings anyway (since people
can't read and understand capabilities of drivers they use) so this
is a best effort attempt at trying to tell people about using these.
Change-Id: Id1749839f7af6bbafb82ab000844294700d74213
Current we store member information in file with suffix ".raw",
To be explicit, we can skip other files, that make us add other type
information file without breaking method get_members.
Change-Id: Ic215f0d51c2440c0847bf11eec3c84d8aebabec1
The 'blocking' argument typically either means blocking as a bool
or blocking true but with the given timeout, so in various drivers they
handle this multi-type argument in nearly the same manner. To unify
that usage we can just have a utils method that breaks the multi-type
argument into its components and uniformly use that in drivers.
Change-Id: I0a6c4b50919fab72d383b9c9f2e772fc931cb6b8
Certain functionality of drivers must be observed when
using a given driver (for example calling periodically
into the heartbeat method) by the user of a coordination
driver so to start with an important one explicitly
declare (and make introspectable the periodic_heartbeat
requirement that certain drivers demand to
operate correctly).
Change-Id: I999a6f8a9fa0bd4bb9ce16370cc38dac4043b085
If connection fails to be established, the acquired attribute does not
exist and then you see warning such has:
Exception AttributeError: "'MySQLLock' object has no attribute 'acquired'" in
<bound method MySQLLock.__del__ of <tooz.drivers.mysql.MySQLLock object at 0x7f79479056d0>>
Change-Id: Id61775483c91ba4127d9dd8cb56d6629a51d7081
Running the tests on a system with IPC that does not support
non-blocking lock make the test thread fail, and then waiting forever on
the thread.
Allow the test to pass if the driver raises NotImplemented.
Change-Id: I2c9e29d317895080cdb6db7109b2528b8d7761ab
Distributed locks have the tendency to become acquired
and then after this point, perhaps becoming unacquired since
locks are typically on a remote machine and things like
network disconnects and such can (and do) happen causing
the running application to need an ability to check if it
is still the owner of the lock (and react appropriately).
Change-Id: I31a79a093c14c31b47f7f0b2a7bb06d77a793186
* Remove support for python 2.6
* Remove skipsdist : Needs to be set only if
sdist is expensive
* Remove usedevelop : only needed when skipsdist
is set to True
* Remove install_command : We can just use the
default, we don't need to override
Change-Id: If054a295dc58636bd317491e0f6cd454d1821a3e
In situations where the built-in (and default) kazoo
threading async handler does not work (which sometimes
appears to happen under eventlet) allow for specifying
a different handler (ie the 'eventlet' one) that should
work better under those scenarios.
Closes-bug: #1512001
Change-Id: Iec5e39928b223a3ffca0b9b5b4d0fd61abaa0f2b
Add the .coveragerc configuration consistent with other projects, specifically to
define including branch = True and omit including tests in the coverage reports
Change-Id: I9c7cdd807ebaaa5ade07be5421063530a5bc6976
By setting this pbr option in setup.cfg, the doc build will fail in case
of any warnings or errors occur during the build process.
Change-Id: Ia6b9cef8933ade60810a48d1813a6f3b3dc72103
Expose Znode statistics like creation time, update time,
number of children and capabilities(data). This is useful
when the consumer say Nova Servicegroup wants to make
decision based of the content of the Znode information.
Change-Id: I3da8fc0e2c76d83dbd2133bb8a41cc1ffeb6d807
Closes-Bug: #1493990
This patch adds the posibility of passing the blocking argument to the
context manager to be used when acquiring the lock.
Previous behavior will be preserved, so now we will be able to use the
context manager in any of the following ways:
with lock(10.0):
with lock(False):
with lock():
with lock:
The last 2 are equivalent.
Change-Id: I6d2f486ac45078ec4ce77de52b7997f2122d4dc8
Right now RedisLock's __init__ method is not calling its super __init__
method, as it should be doing.
It's also using attribute named "_acquired" instead of "acquired" and
creating a property name instead of using inherited name attribute like
other methods are.
This patch changes these behaviors to be consistent with other locks.
Change-Id: If642522637c653a1fb9ad345570fe8a53930cd53