It is great to ensure that the examples that tooz has actually run
during testing time, so enable this as well as adjust the examples
to create unique group ids and run for a limited amount of time instead
of running forever (and fix a few other brokeness)...
When an exception message is in unicode we should not fail
when trying to get that unicode containing exceptions message
so instead of using str() use a new utils function that has
been working in other projects to attempt to convert a exception
message into its corresponding unicode in a safer manner.
It appears the the other drivers have a acquire that does not
take a timeout, but the zookeeper driver has a acquire method that
does take a timeout.
To be more consistent just standardize on the acquire not taking
a timeout paramater and having it provided by the driver options
like the IPC and memcached drivers do.
It seems like the other drivers (if they use a proxy object
to do the locking) hide the lock in the external non-proxy
object so this changes mirrors that hiding of the proxy object
instead of exposing it.
Instead of assuming the lock was released (when it might have
not been) be more reliable and return whether it really was
or was not by validating the reply.
Adjust the docs to better describe why a fake storage
class attribute exists and how it is used and what it
represents compared to a real zookeeper setup.
If for some reason the heartbeat can not occur instead
of failing silently it is better to at least log a message
so that operators can investigate the underlying issue.
To ensure the docs are style checked add in doc8 to the
py27 tox environment so that the docs will be checked.
This also adjusts the one issue that was found in one
of the rst files.
Remove the usage of lockutils (and surronding oslo modules)
and keep it much simpler by just using the sysv_ipc module
This adjustment reduces the complexity, test exposure and
API complexity of tooz; removing much of the complex functionality
that was pulled in when sucking in the lockutils module for its
simple (but still broken) posix_ipc logic.
Since openstack infra already runs these services (or will)
we should just use them when we can. Also for developers that
already have these services running we should use them when
we can instead of trying to recreate them.
The zake driver should theoretically function the same as the
non-local driver so all the same kazoo functions should work,
without the whole distributed part as they work with the regular
zookeeper backed kazoo driver.
Some code in the drivers might actually raise the standard
NotImplemented error, and that would be a bug to skip a test if that was
the case. In that case we want the test to fail.
So let's switch to a custom exception that is used to skip the test if
While iterating over the acquired lock list we
do not want the lock.release call to mutate the
list that we are currently iterating over. To fix
this just iterate over a copy instead so that the
lock.release can remove without issue.
That is needed to prevent Zake driver load in real-life Zookeeper
usage - currently we had the situation when even if you want to use
just KaZoo, you needed to install partially test-requierements
Latching on to an exact version is going to make it for consumers
of tooz+kazoo, which may themselves use a newer version, to be able
to correctly install tooz.
I'm also pretty sure there isn't any reason to bind to exactly 1.3.1
and allowing newer versions (which for now is up to 2.0) should be
0.1 brings in quite a few new hotness than prior
to it. The big one is multi-client -> single storage
which mimics many zookeeper clients attached to
the same zookeeper.
We reuse our lock code to manage the leader election, a.k.a. eat our own
This also fixes the issue that all lock were not released when stop()
It appears that sometimes with memcached, the acquire of the lock takes
a little more time than expected, so let's be blocking instead to be
sure we grab it.