Skip to content

Commit 95b7cd5

Browse files
authored
Merge branch 'master' into feat/container_ttl
2 parents 2804f7e + 9bb8499 commit 95b7cd5

28 files changed

+585
-169
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Kazoo Awesome Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build-and-release:
10+
name: Build and release Kazoo to Pypi
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Handle the code
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Python 3.9
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: 3.9
20+
21+
- name: Install pypa/build
22+
run: >-
23+
python -m
24+
pip install
25+
build
26+
--user
27+
28+
- name: Build a binary wheel and a source tarball
29+
run: >-
30+
python -m
31+
build
32+
--sdist
33+
--wheel
34+
--outdir dist/
35+
.
36+
37+
- name: Publish Kazoo to PyPI
38+
if: startsWith(github.ref, 'refs/tags')
39+
uses: pypa/gh-action-pypi-publish@master
40+
with:
41+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/testing.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Kazoo Awesome Testing
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- release/*
8+
pull_request:
9+
branches:
10+
- master
11+
- release/*
12+
13+
jobs:
14+
test:
15+
name: >
16+
Test Python ${{ matrix.python-version }},
17+
ZK ${{ matrix.zk-version }}
18+
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
matrix:
23+
python-version: [3.7, 3.8, 3.9, pypy-3.7]
24+
zk-version: [3.4.14, 3.5.8]
25+
include:
26+
- python-version: 3.7
27+
tox-env: py37
28+
- python-version: 3.8
29+
tox-env: py38
30+
- python-version: 3.9
31+
tox-env: py39
32+
- python-version: pypy-3.7
33+
tox-env: pypy3
34+
steps:
35+
- name: Handle the code
36+
uses: actions/checkout@v2
37+
38+
- name: Set up Python ${{ matrix.python-version }}
39+
uses: actions/setup-python@v2
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
43+
- name: Handle pip cache
44+
uses: actions/cache@v2
45+
with:
46+
path: ~/.cache/pip
47+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
48+
restore-keys: |
49+
${{ runner.os }}-pip-
50+
51+
- name: Handle ZK installation cache
52+
uses: actions/cache@v2
53+
with:
54+
path: zookeeper
55+
key: ${{ runner.os }}-zookeeper
56+
restore-keys: |
57+
${{ runner.os }}-zookeeper
58+
59+
- name: Install required dependencies
60+
run: |
61+
sudo apt-get -y install libevent-dev krb5-kdc krb5-admin-server libkrb5-dev
62+
python -m pip install --upgrade pip
63+
pip install tox
64+
65+
- name: Test with tox
66+
run: tox -e ${TOX_VENV}
67+
env:
68+
TOX_VENV: ${{ format('{0}-{1}', matrix.tox-env, 'gevent-eventlet-sasl,codecov') }}
69+
ZOOKEEPER_VERSION: ${{ matrix.zk-version }}
70+
# TODO: can be removed once tests for ZK 3.4 are removed
71+
ZOOKEEPER_PREFIX: "${{ !contains(matrix.zk-version, '3.4') && 'apache-' || '' }}"
72+
ZOOKEEPER_SUFFIX: "${{ !contains(matrix.zk-version, '3.4') && '-bin' || '' }}"
73+
ZOOKEEPER_LIB: "${{ !contains(matrix.zk-version, '3.4') && 'lib' || '' }}"
74+
75+
- name: Publish Codecov report
76+
uses: codecov/codecov-action@v2
File renamed without changes.

CHANGES.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,68 @@
1+
<a name="2.8.0"></a>
2+
## 2.8.0 (2020-07-11)
3+
4+
5+
#### Features
6+
7+
* **chore:** using Github templates for issues and PRs (#610) ([eddc0976](https://github.com/python-zk/kazoo/commit/eddc0976bf1ef9d9fb97990cebbc3f9b1abe9d7d))
8+
* **core:**
9+
* Use strict regex to identify lock contenders. ([cc8ce892](https://github.com/python-zk/kazoo/commit/cc8ce8929116a1f0a2f0d088afa82ac9576395dc))
10+
* Support additionaal lock contenter patterns ([225eeecb](https://github.com/python-zk/kazoo/commit/225eeecbe66c10d46dc7928681783d17f389f13a))
11+
* **tests:**
12+
* Disable problematic hound-flake8-black integration. ([75f62a0d](https://github.com/python-zk/kazoo/commit/75f62a0dd40a9f9bdefcb04cea5ee5fcd3438c0e))
13+
* Move to pytest ([de97d74b](https://github.com/python-zk/kazoo/commit/de97d74b50b62cd2f0cddc2a04e150575d9c6bc7))
14+
* add Python 3.8 and remove Python 3.6 from the testing suite (#611) ([e4f808f7](https://github.com/python-zk/kazoo/commit/e4f808f7f0fe17e7e01468a2c54684f048e12b52))
15+
16+
#### Performance
17+
18+
* **core:** Use chain.from_iterable in threading.py (#614) ([13c73ec5](https://github.com/python-zk/kazoo/commit/13c73ec5f4d4f2215deb987a059051bb821674ca))
19+
20+
#### Bug Fixes
21+
22+
* **core:**
23+
* handle SSL_WANT_READ/WRITE errors (#619) ([cbdc4749](https://github.com/python-zk/kazoo/commit/cbdc4749edb5879099c1f9b832c055d9eeb52dea), closes [#618](https://github.com/python-zk/kazoo/issues/618))
24+
* '"is" with a literal' syntax errors (#609) ([6b6ffe62](https://github.com/python-zk/kazoo/commit/6b6ffe62a073d1ed5413c65c2d8ec94ea2fa1760))
25+
* sync() return should be unchrooted ([cbde70ac](https://github.com/python-zk/kazoo/commit/cbde70ac87435afbbacc9806c675184c7f778343), closes [#601](https://github.com/python-zk/kazoo/issues/601))
26+
27+
#### Chore
28+
29+
* **core:** Update matrix: add pypy3, drop py27 ([522189da](https://github.com/python-zk/kazoo/commit/522189da0f238faafc8f1db34f682f49b15ec503))
30+
* **tests:** Add coverage report on codecov.io ([bb475843](https://github.com/python-zk/kazoo/commit/bb475843905af1a2d25b1f5834085c85c28bb175))
31+
32+
33+
34+
<a name="2.7.0"></a>
35+
## 2.7.0 (2020-03-13)
36+
37+
#### Features
38+
39+
* **CI:** Keep only Python 3.{6,7} to CI and bump ZK versions to latests (#574) ([c293aabf](https://github.com/python-zk/kazoo/commit/c293aabf39676b94006cf736f9f75392637b8292))
40+
* **core:**
41+
* run SASL Kerberos tests as part of build ([5c461bdf](https://github.com/python-zk/kazoo/commit/5c461bdff50efd762805b40fbe283b194d175c61))
42+
* Add create2 support ([1d81f96a](https://github.com/python-zk/kazoo/commit/1d81f96a77a6fd7ae2476cd798a5cb4bf1c1d9a2))
43+
* closed states instead of lost states (#573) ([961b2f3b](https://github.com/python-zk/kazoo/commit/961b2f3be557f8314ab41f75444125222638f9cc))
44+
* improve SASL interface (#546) ([cd49b3fa](https://github.com/python-zk/kazoo/commit/cd49b3fa01136848c5e6bfafb4c241b9704f249d))
45+
* **recipe:** add support for curator SharedCount recipe (#559) ([88b657a0](https://github.com/python-zk/kazoo/commit/88b657a0977161f3815657878ba48f82a97a3846), closes [#558](https://github.com/python-zk/kazoo/issues/558))
46+
* **utils:** extend create_tcp_connection utility (#568) ([ab0cd00c](https://github.com/python-zk/kazoo/commit/ab0cd00c12624b07dcc3b2d62aa96f8f1e658f65))
47+
48+
#### Bug Fixes
49+
50+
* **CI:** deploying only for 1 job ([0ba3634d](https://github.com/python-zk/kazoo/commit/0ba3634d99740c9ccc2dd01924a36dffff262f8e))
51+
* **core:**
52+
* allow requests to be queued in CONNECTING state (#374) (#588) ([a636d7a6](https://github.com/python-zk/kazoo/commit/a636d7a6bb88ab9080e902983b10c8f0f1bf60a8))
53+
* Implement proper retry backoff logic with jitter. ([0bb0659c](https://github.com/python-zk/kazoo/commit/0bb0659cf3fd73714a9d75b093a75c7122e116e6))
54+
* when connection fails, close the ConnectionHandler (#577) (#579) ([c7e80503](https://github.com/python-zk/kazoo/commit/c7e80503f3be97d26ff2de27f9e424070c8181bb))
55+
* **recipe:** crash if None in znode (#569) ([ded79467](https://github.com/python-zk/kazoo/commit/ded79467a8254e43841dfeb69f7c3baa1980232c))
56+
* **tests:**
57+
* Disable JAAS isInitiator for Server ([933b38b5](https://github.com/python-zk/kazoo/commit/933b38b5506d84e05ed6f6c5c8c208a3367400da))
58+
* deactivate TCP port that was enabled by default. ([d7bed550](https://github.com/python-zk/kazoo/commit/d7bed550fee1b861eb2ee81cc685e6d08ee35c34))
59+
* capitalize the default_domain value ([7fd22bfd](https://github.com/python-zk/kazoo/commit/7fd22bfd1992b90042db7946949ce992ddfd1821))
60+
* weaker crypto when configuring Kerberos ([844df87a](https://github.com/python-zk/kazoo/commit/844df87ac83e72c155367cfe4ff4d52d34d46c99))
61+
* prefix with toxinidir variable with a / to ensure path to ensure-zookeeper-env.sh is correct ([c4d42ca7](https://github.com/python-zk/kazoo/commit/c4d42ca7722dec5332ecd4524e8d802a81e2ddca))
62+
* specify -Dfile.encoding=UTF-8 when starting the ZK JVM ([5764da0b](https://github.com/python-zk/kazoo/commit/5764da0b3c25556cb6760f68c51b387f2fd8307b))
63+
64+
65+
166
<a name="2.6.1"></a>
267
### 2.6.1 (2019-01-22)
368

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ BUILD_DIRS = bin build include lib lib64 man share
77

88
PYTHON_EXE = $(shell [ -f $(PYTHON) ] && echo $(PYTHON) || echo python)
99
PYPY = $(shell $(PYTHON_EXE) -c "import sys; print(getattr(sys, 'pypy_version_info', False) and 'yes' or 'no')")
10-
TRAVIS ?= false
11-
TRAVIS_PYTHON_VERSION ?= $(shell $(PYTHON_EXE) -c "import sys; print('.'.join([str(s) for s in sys.version_info][:2]))")
10+
CI ?= false
11+
CI_PYTHON_VERSION ?= $(shell $(PYTHON_EXE) -c "import sys; print('.'.join([str(s) for s in sys.version_info][:2]))")
1212

1313
GREENLET_SUPPORTED = yes
14-
ifeq ($(findstring 3.,$(TRAVIS_PYTHON_VERSION)), 3.)
14+
ifeq ($(findstring 3.,$(CI_PYTHON_VERSION)), 3.)
1515
GREENLET_SUPPORTED = no
1616
VENV_CMD = $(PYTHON_EXE) -m venv .
1717
else
@@ -33,7 +33,7 @@ ifeq ($(GREENLET_SUPPORTED),yes)
3333
$(INSTALL) -U -r requirements_eventlet.txt
3434
$(INSTALL) -U -r requirements_gevent.txt
3535
endif
36-
ifneq ($(TRAVIS), true)
36+
ifneq ($(CI), true)
3737
$(INSTALL) -U -r requirements_sphinx.txt
3838
endif
3939
$(INSTALL) -U -r requirements.txt

kazoo/handlers/eventlet.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
import logging
66

77
import eventlet
8-
from eventlet.green import select as green_select
98
from eventlet.green import socket as green_socket
109
from eventlet.green import time as green_time
1110
from eventlet.green import threading as green_threading
11+
from eventlet.green import selectors as green_selectors
1212
from eventlet import queue as green_queue
1313

1414
from kazoo.handlers import utils
1515
import kazoo.python2atexit as python2atexit
16-
16+
from kazoo.handlers.utils import selector_select
1717

1818
LOG = logging.getLogger(__name__)
1919

@@ -41,6 +41,7 @@ class TimeoutError(Exception):
4141

4242
class AsyncResult(utils.AsyncResult):
4343
"""A one-time event that stores a value or an exception"""
44+
4445
def __init__(self, handler):
4546
super(AsyncResult, self).__init__(handler,
4647
green_threading.Condition,
@@ -164,7 +165,8 @@ def create_connection(self, *args, **kwargs):
164165

165166
def select(self, *args, **kwargs):
166167
with _yield_before_after():
167-
return green_select.select(*args, **kwargs)
168+
return selector_select(*args, selectors_module=green_selectors,
169+
**kwargs)
168170

169171
def async_result(self):
170172
return AsyncResult(self)

kazoo/handlers/gevent.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
import gevent.queue
1010
import gevent.select
1111
import gevent.thread
12+
import gevent.selectors
13+
14+
from kazoo.handlers.utils import selector_select
15+
1216
try:
1317
from gevent.lock import Semaphore, RLock
1418
except ImportError:
@@ -17,7 +21,6 @@
1721
from kazoo.handlers import utils
1822
from kazoo import python2atexit
1923

20-
2124
_using_libevent = gevent.__version__.startswith('0.')
2225

2326
log = logging.getLogger(__name__)
@@ -84,6 +87,7 @@ def greenlet_worker():
8487
del func # release before possible idle
8588
except self.queue_empty:
8689
continue
90+
8791
return gevent.spawn(greenlet_worker)
8892

8993
def start(self):
@@ -122,7 +126,8 @@ def stop(self):
122126
python2atexit.unregister(self.stop)
123127

124128
def select(self, *args, **kwargs):
125-
return gevent.select.select(*args, **kwargs)
129+
return selector_select(*args, selectors_module=gevent.selectors,
130+
**kwargs)
126131

127132
def socket(self, *args, **kwargs):
128133
return utils.create_tcp_socket(socket)

0 commit comments

Comments
 (0)