On python2 in case of unicode objects, str() was causing UnicodeEncodeError.
Also utf8 encoding as a default (mostly for Python2)
Change-Id: I64373133f65c5b11daa3462b7c21a55d06738c09
(cherry picked from commit 17b9e9d42c)
This is a mechanically generated patch to complete step 1 of moving
the zuul job settings out of project-config and into each project
repository.
Because there will be a separate patch on each branch, the branch
specifiers for branch-specific jobs have been removed.
See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html
Change-Id: I6b73501855b8e433ead9f24ec0fe30defe80363c
Story: #2003250
build-openstack-sphinx-docs jobs fail on stable branches due to the new
pip version 10 introduces some previously Warning as Error: in case of
calling "pip install" without any package name, the command fails.
tox_install.sh is called during docs job without any package passed to pip.
Change-Id: I860a8776bb32e8e05abd914110ca8df24d869bd2
The `hash` method is random on Python 3, so it's not consistent between. Just
use the string representation of the object as a default.
Change-Id: I84e2b19b64dc1641f9758429248dc6b928122b18
Closes-Bug: #1743243
(cherry picked from commit 62fd552e1e)
Convert all tox jobs to be Zuul v3 native. This uses the shared
openstack-tox as base.
Add doc/requirements.txt
Fix doc building with new PTI changes and job updates.
Add a doc/requirements.txt file with all needed dependencies.
Change-Id: Ic89940a03e308fab051b8051ff281724e6488306
(cherry picked from commit bbe3a4300a)
(cherry picked from commit e7afb739bf)
For Etcd3Lock, blocking call to acquire an already acquired lock fails
when the thread/process, that acquired the lock takes more than the
timeout specified for the lock.
Scenario
========
1. First thread acquires a lock "Lock1"
2. Second thread tries to acquire "Lock1" with blocking=True
3. First thread releases lock after few minutes
4. Second thread tries to acquire it and fails with exception:
ToozError: Not found
Cause
=====
Lease gets created when the lock is created and the default timeout is
30 secs. Since the first thread takes more than 30 seconds to complete,
the lease for the second thread gets expired leading to "Not found"
message.
Resolution
==========
Create lease within Etcd3Lock.acquire() rather than
Etcd3Lock.__init__() of Etcd3Lock
Change-Id: Ief75675ebde2d824a25aec6210e2a868cf3dbbe7
Closes-Bug: #1708836
The failure scenarios where LockError is raised is either:
- Lock is not locked. Then it should not be in _acquired_locks, so discard
should be a no-op.
- Token changed. That can happen if the lock timed-out (and somebody else
grabbed it). Then the lock is not longer owned anyway so let's remove it.
If releasing the lock fails, there's no way heartbeat will work anyway. So just
remove the lock from acquired locks and let it die anyway.
Change-Id: I44db39e83db7e6c0f17079584e49c8de34b51ce1
list-table is easier to be maintained.
In addition, we avoid too long lines.
We no longer have too long lines which doc8 complains,
so doc8 ignore_path can be dropped.
Change-Id: I574391295288ef9e33744aa608c2f2930a6e46f8
- Update sphinx so that warning-is-error option is available
- Fix sphinx warnings
- Install python modules required for automodule into docs env
- Fix docstring warning in tooz/coordination.py
- pbr warnerrors is no longer needed in favor of sphinx warning-is-error
Change-Id: I5d54c452522b6ee00884d7d17105af22b4c95189
- add a test to be sure that no lock refresh is made on non-acquired locks
- add thread safety for etcd3 drivers on heartbeat() (like Redis)
Change-Id: I350ea10163d59a06712c22c4c5be4dfcb6885bf8
The code in python-etcd3 for locks has been adjusted to reflect how tooz wants
his lock to work. That's amazing because now we can use them directly and not
implement our own locking mechanism!
Change-Id: Ia5741bae83cddd90f9bb78fba9173dca8509e6d9
The capabilities was meant to be a byte string only, but since now all drivers
have been enhanced to serialize the data in a way or another, it accepts
anything. There's no need to pass a byte string anymore.
Change-Id: Ib732dccd18d67edd9e39e990b8ca3a8da7ab5663
The connection is supposedly closed when blocking is False and the lock is not
acquired. Or when an exception happens in the locking code.
But if blocking is e.g. 5 seconds, then RetryError is raised but without
closing any connection at the end. This fixes that.
Change-Id: I7b40e466fe5fc01ee3f8c012f765aafca9ce716a
gRPC (used by python-etcd3) is not able to work correctly with fork. One can
only use it in the child or master process, but not both. Therefore this test
will fail or hang forever.
Change-Id: I32453d2d968faefeffcff1f5b70b46daec36c300
This should make it easy to run any Python version test, e.g. Python 3.6,
without any further change.
Change-Id: I91a47b736371549e50b7c7fd60e46e0f87c357ae