summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* feat(testing): add more logging during test suiteHEADmasterStephen Sorriaux2023-04-244-4/+14
| | | | | | | Activate `pytest`'s `logcli` setting to better read the client lifecycle during testing. Add `log()` function to KazooTestHarness class so that it is possible to log like crazy when something is not working Display the ZK client port in logs when starting a ZK server (useful for test "debug") Be able to get more than the last 100 lines of ZK logs (can be useful, believe me)
* fix(testing): cleanup ZK cluster between test casesStephen Sorriaux2023-04-241-2/+30
| | | | | Now performing a ZK cluster nuking at the end of each test case since keeping the same ZK state from test cases to test cases actually led to some tests randomly failing. Added `client_cluster_health` ZK client in the `setup_zookeeper()` step that is there to "guarantee" the cluster is up and running, without even considering the configuration that will be used by the test itself.
* fix(tests): `test_read_only` is not flaky anymore.Stephen Sorriaux2023-04-242-5/+18
| | | | | Fixed the `test_read_only` test based on what is done in the official Java client, we were missing some things and that led the test to fail from time to time (see comments in the code for full story). Also renamed `test__connection.py` to `test_connection.py`, where it belongs.
* feat(ci): remove `codecov` step from `tox` since performed in GA (#719)Stephen Sorriaux2023-04-102-5/+1
| | | There is no need to perform the non-working `codecov` step via `tox` since we now have a Github Actions step that performs it.
* fix(testing): add `.coveragerc` (#718)Stephen Sorriaux2023-04-101-0/+6
| | | This fixes the `coverage` configuration that is wrongly giving a test coverage for the `tests` and `testing` folders and ends up "blocking" PR because of `codecov`.
* Merge pull request #710 from ceache/feat/docsCharles-Henri de Boysson2023-02-184-6/+34
|\ | | | | chore(core): Fix documentation build
| * docs: Include type hints in docsCharles-Henri de Boysson2023-02-142-0/+2
| |
| * docs: Use `.readthedocs.yaml` to configure the buildCharles-Henri de Boysson2023-02-142-6/+32
|/
* Fix possible endless wait in stop() after AUTH_FAILED error (#688)Azat Khuzhin2023-02-072-1/+3
| | | | | | | | | | | | | | | | | | | | | In case of AUTH_FAILED in the zk-loop thread it will call client._session_callback which will reset the queue. However another thread can add to this queue CloseInstance event, and if the _session_callback() will be called after CloseInstance was added to the queue, then stop() will never return (and zk-loop will endlessly spin). Here is how it looks like with addititional logging: 39: [ Thread-3 (zk_loop) ] INFO: client.py:568: _session_callback: Zookeeper session closed, state: AUTH_FAILED 39: [ MainThread ] Level 5: client.py:721: stop: Sending CloseInstance 39: [ Thread-3 (zk_loop) ] Level 5: client.py:403: _reset: Reseting the client 39: [ Thread-3 (zk_loop) ] Level 5: connection.py:625: _connect_attempt: Connecting 39: [ Thread-3 (zk_loop) ] Level 5: connection.py:625: _connect_attempt: Connecting You can find details in this gist [1]. [1]: https://gist.github.com/azat/bc7aaea1c32a4f1ea75ad646d26280e9
* refactor: no need to specify `mock` (#702)Jeff Widman2023-02-059-39/+35
| | | | | It's now part of the Python stdlib since `3.3`. So no need to specify it.
* Cleanup SSL deprecation warnings under Python 3.10 and newer (#706)Clark Boylan2023-02-051-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this commit python would produce these warnings when using kazoo with ssl: /path/to/venv/lib/python3.11/site-packages/kazoo/handlers/utils.py:225: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) The reason for this is that ssl.PROTOCOL_SSLv23 is an alias for ssl.PROTOCOL_TLS and ssl.PROTOCOL_TLS is deprecated since Python 3.10. ssl.PROTOCOL_TLS was replaced with ssl.PROTOCOL_TLS_CLIENT and ssl.PROTOCOL_TLS_SERVER. In kazoo's case we switch to ssl.PROTOCOL_TLS_CLIENT as kazoo is acting as an ssl client to zookeeper servers. There are a few things to note. PROTOCOL_TLS_CLIENT enables context.check_hostname. We explicitly set this to False as this is required to set ssl.CHECK_NONE which kazoo supports, and not everyone may be using SSL certs with proper hostnames configured. For example if making connections to an IP address rather than a name and the certs don't have IP addrs in their altnames. This ensures backward compatibility with these use cases. Changing this should be done in a separate change and should likely be made configurable like verify_certs. Finally, while we are at it we replace ssl.CERT_OPTIONAL with ssl.CERT_REQUIRED as they are equivalent in a client context. This allows us to delete some code. Python documents all of these behaviors as being present since Python 3.6. Kazoo requires Python 3.7 or newer which should make this safe.
* docs: there are more than 50 contributors now (#703)Jeff Widman2023-02-011-1/+1
| | | | Github reports 105 on the project homepage, details: https://github.com/python-zk/kazoo/graphs/contributors
* refactor: delete back of travis config (#705)Jeff Widman2023-01-311-43/+0
| | | | | | | We've seemed pretty happy with GitHub actions, and now that Travis is owned by PE their product seems to have gone downhill so even if we were looking for an alternative, I don't think Travis would be it. Regardless, this backup will still remain in git history, so no point in duplicating version control via `.bak` files.
* chore: add mypy to the build (#689)Jon Bringhurst2023-01-304-3/+136
| | | The method used here follows the same pattern that SQLAlchemy has been using to add types. For an example, see https://github.com/sqlalchemy/sqlalchemy/pull/9039/files and note the removal of the `# mypy: ignore-errors` comment to incrementally add types.
* chore(deps): bump actions/setup-python from 2 to 4 (#695)dependabot[bot]2023-01-232-3/+3
| | | | | | | | | | | | | | | | | Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps): bump actions/cache from 2 to 3dependabot[bot]2023-01-211-3/+3
| | | | | | | | | | | | | | | Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
* chore(deps): bump codecov/codecov-action from 2 to 3dependabot[bot]2023-01-211-1/+1
| | | | | | | | | | | | | | | Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2 to 3. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v2...v3) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
* chore(deps): bump actions/checkout from 2 to 3dependabot[bot]2023-01-212-3/+3
| | | | | | | | | | | | | | | Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
* Ask Dependabot to bump actionsJeff Widman2023-01-211-0/+6
| | | | | | | I noticed some of our GitHub action workflows are throwing deprecation warnings... Let's have Dependbot open PR's to bump them whenever they're outdated. We could also enable it for watching our Python deps, but that may be more controversial, so that can be done as a follow-on PR if there's interest.
* chore: migrate to tox 4.xJon Bringhurst2023-01-202-5/+6
| | | | tox-wheel is a deprecated package. tox 4.x includes wheel support.
* Merge pull request #678 from a-ungurianu/devx/bye_bye_sixAlex Ungurianu2022-11-2913-197/+71
|\ | | | | refactor: Remove vestiges of python2 support
| * refactor: remove unecessary import guard for gevent.lockAlex Ungurianu2022-11-161-4/+1
| | | | | | | | | | The locks have been moved from `gevent.coros` to `gevent.lock` since version 1.2 ([see changelog](https://www.gevent.org/changelog_1_2.html#a1-oct-27-2016))
| * refactor: remove string interpolation in favour of exception chainingAlex Ungurianu2022-11-162-9/+9
| |
| * test: Don't throw when test fail while cluster is downAlex Ungurianu2022-11-161-4/+5
| |
| * refactor: remove backport of 'atexit.unregister'Alex Ungurianu2022-11-165-81/+10
| |
| * refactor: Replace usage of six for their py3 implementationsAlex Ungurianu2022-11-168-107/+54
|/
* recipe(cache): Use protocol.paths.join instead of os.path.join (#682)Alex Ungurianu2022-11-091-4/+2
| | | os.path.join will do Windows path joining on Windows resulting in bad zookeeper paths
* recipe(lock): Use native Lock timeout instead of reimplementing (#676)Alex Ungurianu2022-10-291-17/+7
| | | Closes #605
* docs: Replace build badge from Travis to Actions (#675)Alex Ungurianu2022-10-211-1/+1
| | | This is to reflect the updated CI pipeline used for the repo
* Merge pull request #673 from ceache/chore/blackCharles-Henri de Boysson2022-10-1762-1447/+2087
|\ | | | | chore(core): Introduce black code formatter
| * chore: Integrate flake8 & black in gh actionsCharles-Henri de Boysson2022-10-173-9/+43
| |
| * chore: bump pyflake, fix new warningsCharles-Henri de Boysson2022-10-1711-31/+32
| |
| * style: ignore reformatting commits in blameCharles-Henri de Boysson2022-10-172-0/+7
| |
| * style: reformat all code with blackCharles-Henri de Boysson2022-10-1754-1408/+1976
| |
| * chore: add black dependencies to the buildCharles-Henri de Boysson2022-10-175-5/+35
|/
* chore: backport changes from release/2.9 (#674)Stephen Sorriaux2022-10-163-1/+34
| | | | | * chore: 2.9.0 release and changelog * chore(ci): override egg_info value when releasing
* chore(packaging): Remove redundant wheel dep from pyproject.toml (#671)Michał Górny2022-10-091-2/+1
| | | | | | | | Remove the redundant `wheel` dependency, as it is added by the backend automatically. Listing it explicitly in the documentation was a historical mistake and has been fixed since, see: https://github.com/pypa/setuptools/commit/f7d30a9529378cf69054b5176249e5457aaf640a Signed-off-by: Michał Górny <mgorny@gentoo.org>
* chore(ci): testing with Python3.10 and ZK 3.5.10, 3.6.3, 3.7.1 (#659)Stephen Sorriaux2022-10-079-13/+77
| | | | | | | | Testing libs have been upgraded. The used java classpath now considers more .jar possible locations. test_connection.py tests is now done first, trying to make it less flaky. conftest.py has been added to give a way to display ZK cluster logs. Because of ZK 3.6 and 3.7 changes, configurations related to local session has been added. Disable GA fail-fast because of the flakiness
* chore: migrate to setup.cfg (#666)Charles-Henri de Boysson2022-09-3014-137/+141
| | | closes #644 #662 #663
* fix(recipe): fix deadlock in r/w lock recipe (#650)Simon Westphahl2022-02-072-9/+71
| | | | | | | | | | | | | The lock must only consider contenders with a sequence number lower than it's own sequence number as also stated in the Zookeeper recipe description for shared locks[0]. This wasn't working correctly as the ReadLock also considered WriteLocks with a higher sequence number as contenders. This can lead to a deadlock as described in #649. [0]: https://zookeeper.apache.org/doc/r3.7.0/recipes.html#Shared+Locks Closes #649
* fix(core): use selectors to poll connections instead of raw select in ↵Wang2022-02-0210-98/+245
| | | | | | | threading,gevent,eventlet (#656) Co-authored-by: lawrentwang <lawrentwang@tencent.com> Solve the select limitation on a maximum file handler value and dynamic choose the best poller in the system.
* Merge pull request #657 from syseleven/sneubauer/fix-deprecation-warningCharles-Henri de Boysson2021-12-024-9/+9
|\ | | | | fix(recipe): fix deprecation warning from threading.Event
| * fix(recipe): fix deprecation warning from threading.EventSteffen Neubauer2021-12-024-9/+9
|/ | | | | | | reasoning: - `is_set` is supported since Python2.6 (https://docs.python.org/2.7/library/threading.html) - Starting from Python3.5 docs the `isSet` spelling is not even mentioned anymore (https://docs.python.org/3.5/library/threading.html) - Python3.10 will give a deprecation warning when the `isSet` spelling is used (https://docs.python.org/3.10/library/threading.html)
* chore(ci): better specify how to trigger Github Actions (#658)Stephen Sorriaux2021-11-292-2/+13
|
* Merge pull request #652 from python-zk/feat/github-actionsBen Bangert2021-11-2711-38/+143
|\ | | | | chore(ci): Replace Travis with Github Actions
| * chore(ci): Replace Travis with Github Actionsfeat/github-actionsStephen Sorriaux2021-08-0511-38/+143
|/
* Merge pull request #635 from timgates42/bugfix_typo_untilCharles-Henri de Boysson2021-01-241-1/+1
|\ | | | | docs: fix simple typo, untill -> until
| * Merge branch 'master' into bugfix_typo_untilJeff Widman2021-01-201-1/+1
| |\ | |/ |/|
* | feat(core): make DNS resolution error retriable (#631)krishna2021-01-201-1/+1
| | | | | | DNS resolution errors were previously not retriable, this commit allows it by changing the value returned when the DNS resolution fails.
| * docs: fix simple typo, untill -> untilTim Gates2020-12-311-1/+1
|/ | | | | | There is a small typo in kazoo/recipe/queue.py. Should read `until` rather than `untill`.