Commit Graph

3681 Commits

Author SHA1 Message Date
Alisson Claudino 8aff4e73cd
fix: freeze set during ticks iter in async hub (#1830)
* test: ticks set size changed during iteration in async hub

* fix: freeze set during ticks iter in async hub
2023-12-19 13:07:56 +02:00
pre-commit-ci[bot] b4235c76f9
[pre-commit.ci] pre-commit autoupdate (#1834)
updates:
- [github.com/pycqa/isort: 5.13.0 → 5.13.2](https://github.com/pycqa/isort/compare/5.13.0...5.13.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-12-18 20:00:05 +02:00
dependabot[bot] 74a804a5d7
Bump github/codeql-action from 2 to 3 (#1832)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-14 11:43:47 +02:00
pre-commit-ci[bot] e8354372e2
[pre-commit.ci] pre-commit autoupdate (#1831)
updates:
- [github.com/pycqa/isort: 5.12.0 → 5.13.0](https://github.com/pycqa/isort/compare/5.12.0...5.13.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-12-11 19:43:01 +02:00
dependabot[bot] 9279d598ae
Bump actions/setup-python from 4 to 5 (#1829)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-07 10:39:15 +02:00
Ataf Fazledin Ahamed 3d6c6dd701
Fixed Improper Method Call: Replaced `mktemp` (#1828)
* Replaced `mktemp` with `mkstemp`

Signed-off-by: fazledyn-or <ataf@openrefactory.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: fazledyn-or <ataf@openrefactory.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-12-06 14:41:13 +02:00
David Rice dfec2912e8
fix(docs): add Redis to the list of transports where SSL is supported (#1826) 2023-11-28 15:01:47 +02:00
Tomer Nosrati e316a35e0f
Fix ReadTheDocs CI (#1827)
* Copied .readthedocs.yaml from Celery repo

* Updated version_dev and version_stable in docs/conf.py
2023-11-28 14:58:50 +02:00
Asif Saif Uddin 562b6f6fef Bump version: 5.3.3 → 5.3.4 2023-11-16 22:21:32 +06:00
Asif Saif Uddin e83a915110 Added Changelog for v5.3.4 release 2023-11-16 22:16:17 +06:00
Rafid K 6121539379
Use the correct protocol for SQS requests (#1807)
* Use the correct protocol for SQS requests

TL;DR - The use of boto3 in #1759 resulted in relying on blocking
(synchronous) HTTP requests, which caused the performance issue reported
in #1783.

`kombu` previously used to craft AWS requests manually as explained in
detail in #1726, which resulted in an outage when botocore temporarily
changed the default protocol to JSON (before rolling back due to the
impact on celery and airflow.) To fix the issue, I submitted #1759,
which changes `kombu` to use `boto3` instead of manually crafting AWS
requests. This way when boto3 changes the default protocol, kombu won't
be impacted.

While working on #1759, I did extensive debugging to understand the
multi-threading nature of kombu. What I discovered is that there isn't
an actual multi-threading in the true sense of the word, but an event
loop that runs on the same thread and process and orchestrate the
communication with SQS. As such, it didn't appear to me that there is
anything to worry about my change, and the testing I did didn't discover
any issue. However, it turns out that while kombu's event loop doesn't
have actual multi-threading, its [reliance on
pycurl](https://github.com/celery/kombu/blob/main/kombu/asynchronous/http/curl.py#L48)
(and thus libcurl) meant that the requests to AWS were being done
asynchronously. On the other hand, boto3 requests are always done
synchronously, i.e. they are blocking requests.

The above meant that my change introduced blocking on the event loop of
kombu. This is fine in most of the cases, since the requests to SQS are
pretty fast. However, in the case of using long-polling, a call to SQS's
ReceiveMessage can last up to 20 seconds (depending on the user
configuration).

To solve this problem, I rolled back my earlier changes and, instead, to
address the issue reported in #1726, I now changed the
`AsyncSQSConnection` class such that it crafts either a `query` or a
`json` request depending on the protocol used by the SQS client. Thus,
when botocore changes the default protocol of SQS to JSON, kombu won't
be impacted, since it crafts its own request and, after my change, it
uses a hard-coded protocol based on the crafted requests.

This solution shouldn't be the final solution, and it is more of a
workaround that does the job for now. The final solution should be to
completely rely on boto3 for any communication with AWS, and ensuring
that all requests are async in nature (non-blocking.) This, however, is
a fundamental change that requires a lot of testing, in particular
performance testing.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update kombu/asynchronous/aws/sqs/connection.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
2023-11-16 14:19:49 +06:00
Asif Saif Uddin 75650c511b Bump version: 5.3.2 → 5.3.3 2023-11-06 18:34:48 +06:00
Asif Saif Uddin fecb0bd845 Added new python versions in classifier 2023-11-06 18:33:33 +06:00
Asif Saif Uddin eefa29b5af Added Changelog for v5.3.3 release 2023-11-06 18:29:05 +06:00
Asif Saif Uddin 85abaa635a
Bump kafka deps versions & fix integration test failures (#1818)
* Bump kafka deps versions

* adjust import

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added missing tox python 3.12 env for kafka

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-11-06 18:13:27 +06:00
Asif Saif Uddin c75c2a0b58
Update pytest version (#1817) 2023-11-06 11:02:20 +02:00
jiangxianfu 3884eb9dd6
fix: redis requeue concurrency bug #1800 (#1805)
* fix: redis requeue concurrency bug  #1800

* fix: add unit test

* fix: update
2023-10-30 19:34:31 +06:00
Asif Saif Uddin 7187021ecc
using assert_called_once() in est__pop_ready_uses_lock (#1813) 2023-10-18 16:14:16 +06:00
Asif Saif Uddin 6c8e7e6b28
added Python 3.12 in the CI (#1812)
* added Python 3.12 in the CI

* try to make kafka work on py3.12

* skip kafka for the time being as it seems not woring with py3.12 yet

* using assert_called_once()
2023-10-18 15:50:39 +06:00
Peter Marheine 3ad075a536
Create a lock on cached_property if not present (#1811)
* Create a lock on cached_property if not present

This fixes #1804 (fixing breakage caused by use of undocumented
implementation details of functools.cached_property) by ensuring a lock
is always present on cached_property attributes, which is required to
safely support setting and deleting cached values in addition to
computing them on demand.

* Add a unit test for cached_property locking
2023-10-18 15:45:10 +06:00
Asif Saif Uddin 1dfe4f3c86
Revert "[fix #1726] Use boto3 for SQS async requests (#1759)" (#1799)
This reverts commit 862d0bc728.
2023-10-10 11:55:38 +06:00
pre-commit-ci[bot] 678c0dbdbd
[pre-commit.ci] pre-commit autoupdate (#1806)
updates:
- [github.com/asottile/pyupgrade: v3.13.0 → v3.15.0](https://github.com/asottile/pyupgrade/compare/v3.13.0...v3.15.0)
- [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-10-09 20:49:43 +03:00
Sergey Romanyuk 2454aa7a4d
Added as_uri method to MongoDB transport - Fixes #1795 (#1796)
* Added as_uri method to MongoDB transport, Added tests

* Make flake8 happy

* Removed unnecessary test
2023-10-04 23:00:35 +06:00
marnikow 0e445d108e
fix azure servicebus using managed identity support (#1801)
* azure servicebus: use DefaultAzureCredential in documentation

* azure servicebus: only use connection string when using sas key

* azure servicebus: add two small tests for paring of connection string

* azure servicebus: fix lint issues
2023-10-04 16:47:36 +06:00
pre-commit-ci[bot] 5f4c5314b0
[pre-commit.ci] pre-commit autoupdate (#1797)
updates:
- [github.com/asottile/pyupgrade: v3.11.0 → v3.13.0](https://github.com/asottile/pyupgrade/compare/v3.11.0...v3.13.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-09-25 22:13:36 +03:00
pre-commit-ci[bot] cc314cb119
[pre-commit.ci] pre-commit autoupdate (#1793)
updates:
- [github.com/asottile/pyupgrade: v3.10.1 → v3.11.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.11.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-09-18 23:35:59 +03:00
dependabot[bot] 0298ef420d Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [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/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 17:34:17 +06:00
Tomer Nosrati 75cb234369 Added .github/dependabot.yml 2023-09-18 17:32:46 +06:00
Asif Saif Uddin b213b5cbbd test redis 5.0.0 2023-09-14 12:56:33 +06:00
pre-commit-ci[bot] 7b10ad7d07
[pre-commit.ci] pre-commit autoupdate (#1782)
updates:
- [github.com/PyCQA/autoflake: v2.2.0 → v2.2.1](https://github.com/PyCQA/autoflake/compare/v2.2.0...v2.2.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-09-04 23:59:08 +03:00
flolas c18e9626e1 raise access denied error when ack 2023-09-04 02:16:00 +06:00
Asif Saif Uddin eaaaab0dfd
Update redis.txt to align with celery main (#1776) 2023-09-01 14:25:17 +06:00
Tomer Nosrati 747d48e8cf Bump version: 5.3.1 → 5.3.2 2023-08-31 12:20:17 +03:00
Tomer Nosrati a69dc80f00 Added Changelog for 5.3.2 2023-08-31 12:20:17 +03:00
Mohd Shoaib f0e6ba9dc8
+ celery with sqs #222 (#1780) 2023-08-31 14:35:10 +06:00
Mohd Shoaib a4efb9c17f
Kombu & celery with SQS #222 (#1779)
* + celery with sqs #222

* Update docs/userguide/connections.rst

* Update docs/userguide/connections.rst

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>

* Update docs/userguide/connections.rst

* Update docs/userguide/connections.rst

* Update docs/userguide/connections.rst

---------

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
2023-08-31 14:14:57 +06:00
mbierma 492776eb7f
fix: Prevent redis task loss when closing connection while in poll (#1733)
* Catch brpop before closing connection

* Update unit test

---------

Co-authored-by: mbierma <3448579-mbierma@users.noreply.gitlab.com>
2023-08-15 10:16:49 +06:00
Jason Barnett 6f8676630d
azure service bus: add managed identity support (#1641) 2023-08-14 20:27:15 +03:00
Tomer Nosrati 55370c7e4c
Fixed pre-commit issues (#1773)
* Fixed pre-commit issues

* Excluded kombu/messaging.py and kombu/serialization.py from yesqa pre-commit
2023-08-04 12:12:20 +06:00
pre-commit-ci[bot] 7090de2f90 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.9.0 → v3.10.1](https://github.com/asottile/pyupgrade/compare/v3.9.0...v3.10.1)
- [github.com/PyCQA/flake8: 6.0.0 → 6.1.0](https://github.com/PyCQA/flake8/compare/6.0.0...6.1.0)
2023-08-02 11:20:09 +06:00
pre-commit-ci[bot] dc50c0b4f5 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.8.0 → v3.9.0](https://github.com/asottile/pyupgrade/compare/v3.8.0...v3.9.0)
2023-07-11 13:14:49 +06:00
JaeyoungHeo c73e560def Remove SimpleQueue import 2023-07-07 20:45:00 +06:00
pre-commit-ci[bot] 82b2529703
[pre-commit.ci] pre-commit autoupdate (#1763)
updates:
- [github.com/asottile/pyupgrade: v3.7.0 → v3.8.0](https://github.com/asottile/pyupgrade/compare/v3.7.0...v3.8.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-07-04 13:25:20 +03:00
Rafid K 862d0bc728
[fix #1726] Use boto3 for SQS async requests (#1759)
* [fix #1726] Use boto3 for SQS async requests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-06-27 10:06:41 +06:00
pre-commit-ci[bot] 68cb9ce011
[pre-commit.ci] pre-commit autoupdate (#1760)
updates:
- [github.com/PyCQA/autoflake: v2.1.1 → v2.2.0](https://github.com/PyCQA/autoflake/compare/v2.1.1...v2.2.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-06-27 05:02:40 +03:00
Cyril Roelandt 6ef88c3445 Python3.12: fix imports in kombu/utils/objects.py
Consider the following piece of code, very similar to what can be found
in kombu/utils/objects.py:
---8<------------------------------------------------------------------
$ cat  /tmp/x.py
try:
    from functools import _NOT_FOUND
    from functools import cached_property as _cached_property
except ImportError:
    from cached_property import threaded_cached_property as _cached_property
    _NOT_FOUND = object()

print("OK!")
---8<------------------------------------------------------------------

This works well in Python3.11:
---8<------------------------------------------------------------------
$ podman run -it --rm -v /tmp:/tmp python:3.11.4  python /tmp/x.py
OK!
---8<------------------------------------------------------------------

But fails in Python3.12:
---8<------------------------------------------------------------------
$ podman run -it --rm -v /tmp:/tmp python:3.12.0b2  python /tmp/x.py
Traceback (most recent call last):
  File "/tmp/x.py", line 2, in <module>
    from functools import _NOT_FOUND
ImportError: cannot import name '_NOT_FOUND' from 'functools' (/usr/local/lib/python3.12/functools.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/x.py", line 6, in <module>
    from cached_property import threaded_cached_property as _cached_property
ModuleNotFoundError: No module named 'cached_property'
---8<------------------------------------------------------------------

This is because Python3.12 removed functools._NOT_FOUND (see commit
056dfc71dce15f81887f0bd6da09d6099d71f979), which prevents
cached_property from being imported from functools in our code. If the
cached_property library is not installed, then the imports fail.

We should be using two different try/except blocks, but since
functools._NOT_FOUND was defined as "object()" in the standard library
anyway, let's just not bother importing it.
2023-06-22 12:38:35 +06:00
Tomer Nosrati b21592bab3
Doc fix (hotfix for #1755) (#1758) 2023-06-20 23:03:10 +03:00
pre-commit-ci[bot] 18344cd0a4
[pre-commit.ci] pre-commit autoupdate (#1757)
updates:
- [github.com/asottile/pyupgrade: v3.6.0 → v3.7.0](https://github.com/asottile/pyupgrade/compare/v3.6.0...v3.7.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-06-19 22:38:11 +03:00
Tomer Nosrati 18edd4c848 Reverted unwanted constraint introduced in #1629 with max_retries not being able to be None (when it should) 2023-06-19 09:54:28 +06:00
Asif Saif Uddin a32c0c8baf Bump version: 5.3.0 → 5.3.1 2023-06-15 19:14:40 +06:00