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)...
Change-Id: I573cf5946a1d3f13862c0c28cf3a5d7fc6178873
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.
Change-Id: I202f12d8f9bf562972b760f91805dba2ad14d804
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.
Change-Id: I86d5197ad57a4c891615e100365347e3e0bdd4c3
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.
Change-Id: I2bd8f8c9f66aed960d14784053b9b32999ac394e
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.
Change-Id: I70b2e1946d5101c7fbbf4ed9f15007bb98e92581
Instead of using a queue like a deque just use
a deque directly instead, a queue doesn't seem
to add much value when its used like it was.
Change-Id: I515c14bb16e18c4031f446c7176915c94b3fb8f4
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.
Change-Id: I255ccd83c8033266e9cee09a343468ae4e0f2bfd
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.
Change-Id: Ide88314c413afa389d6c039478324d6e47f63e82
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.
Change-Id: Iea38d4ac53d9c5255e0694a840c38b04530890ce
Remove the usage of lockutils (and surronding oslo modules)
and keep it much simpler by just using the sysv_ipc module
directly.
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.
Change-Id: I46db9bda252473317a0f3d65fe0329ac2151f332
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.
Change-Id: I8655e5365ad36c57836f87e147102e2d02db7830
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.
Change-Id: I19df0da0e58c5624ca1b10f61c42510f1f104847
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
it's raised.
Change-Id: Ideafee0b1f008ff32724fb98d6a477bd3976104d
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.
Change-Id: I157331ca116b97e17d10854b5227ac7ee67fac57
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
(zake package).
Change-Id: I9664fda2d6e76a6e48776b4a6d92af4c4baf1425
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
fine.
Change-Id: I0dc810c2d9dbf5ff04cb5000b843ad4ac772fc43
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.
Change-Id: Iee6f4157743a094dd0d59dc12e66592594d54792
We reuse our lock code to manage the leader election, a.k.a. eat our own
dog food.
This also fixes the issue that all lock were not released when stop()
was called.
Change-Id: Ibbec3e8ac29d55247ec3b1b8941d5a9569b67677
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.
Change-Id: I87031c8c3523d0ec5dec1a9e3e585cfa3821eb8b