Commit Graph

3161 Commits

Author SHA1 Message Date
Omer Katz a130c46367 Run tests with PyPy 3.6-7.3.1. 2020-08-04 16:35:39 +03:00
Omer Katz d463879cd9 Restore this import compatibility code.
This was removed because I thought it's for Python<3 but it's for Python<3.7.
2020-08-04 16:30:58 +03:00
Omer Katz 3495d64810 Merge branch 'master' into remove-python2-support 2020-07-30 18:24:05 +03:00
Omer Katz 22f95cb5ee Remove flakeplus from the build. 2020-07-30 17:01:09 +03:00
Omer Katz 0146ed16b2 Adjust setup.py. 2020-07-30 16:44:04 +03:00
Omer Katz 6134d80270 Drop testing for Python < 3.6. 2020-07-30 16:43:51 +03:00
Christian Clauss 92b8c32717
flake8: noqa the Python 2-only builtins (#1228)
* flake8: noqa the Python 2-only builtin cmp()

* flake8: buffer() was removed in Python 3

* flake8: unicode() was removed in Python3 because all str are Unicode

Adds the modifications from #1227
2020-07-28 21:50:18 +06:00
Christian Clauss ed35d9f0a9
buffer() was removed in Python 3 so use bytes (#1218)
* buffer() was removed in Python 3 so use memoryview

https://docs.python.org/2.7/library/stdtypes.html#memoryview-type

* buffer = bytes on Python 3

* from kombu.five import buffer

* buffer --> buffer_t

* @patch('buffer_t') in test_qpid.py

* @patch('kombu.five.buffer_t')

* Use buffer on legacy Python and bytes on Python

* Update test_qpid.py
2020-07-28 17:20:14 +03:00
Christian Clauss b4581289fa
tox.ini: Lint on Python, not on legacy Python (#1217)
* tox.ini: Lint on Python, not on legacy Python

* Travis CI: Lint on Python, not on legacy Python

* Update .travis.yml

* Update .travis.yml

Co-authored-by: Omer Katz <omer.drow@gmail.com>

* flakeplus only works on legacy Python

Co-authored-by: Omer Katz <omer.drow@gmail.com>
2020-07-28 16:00:43 +03:00
Omer Katz 57de7d3976 Delete five. 2020-07-23 16:33:49 +03:00
Omer Katz 2c75db39e0 Remove five usage from tests. 2020-07-23 16:33:40 +03:00
Omer Katz 7bc0e1d073 Remove five usage from kombu/. 2020-07-23 16:32:53 +03:00
Omer Katz 1916b815f8 Remove five usage from kombu/utils. 2020-07-23 16:29:29 +03:00
Omer Katz 24ed1179b5 Remove five usage from kombu/transport. 2020-07-23 16:29:21 +03:00
Omer Katz ff48da68b7 Remove five usage from kombu/asynchronous. 2020-07-23 16:29:10 +03:00
Omer Katz 7a6e7cc45b pyupgrade 2020-07-13 16:58:06 +03:00
Krzysztof Jagiello 016f4accb6 Add an SQS transport option for custom botocore config 2020-07-01 21:31:40 +06:00
Asif Saif Uddin (Auvi) 90a12a1ad6 v4.6.11 2020-06-24 13:06:28 +06:00
Asif Saif Uddin (Auvi) d6490cc682 changelog for v4.6.11 2020-06-24 13:06:04 +06:00
DefteZ bff78a5b6c Improve mention for MongoDB transport mention in docs 2020-06-14 08:12:45 +06:00
Matus Valo 75027490c7
Revert incompatible changes in #1193 and additional improvements (#1211)
* Revert incompatible changes introduced in #1193

* Improved integration tests covering connection

* Fix unittests on python2 + flake8 fixes
2020-06-10 15:14:47 +06:00
Matus Valo 16749626a4
default_channel should reconnect automatically (#1209) 2020-06-05 09:20:56 +02:00
Asif Saif Uddin (Auvi) ce6d201640 v4.6.10 2020-06-03 10:33:52 +06:00
Asif Saif Uddin (Auvi) 0d542b2ab1 changelog for 4.6.10 2020-06-03 10:30:02 +06:00
Asif Saif Uddin (Auvi) 0f4a2af4a8 Merge branch 'master' of https://github.com/celery/kombu 2020-06-03 09:58:20 +06:00
Asif Saif Uddin (Auvi) b858bfb97b remove un supported classifier 2020-06-03 09:57:58 +06:00
Conor Stevenson ff7c1e3041 reuse connection 2020-06-02 14:11:32 +06:00
Conor Stevenson 255b85229b
set _connection in _ensure_connection (#1205)
Co-authored-by: Conor Stevenson <conor@lendingblock.com>
2020-06-01 23:23:05 +02:00
Matus Valo 1be72e3b6a Improved Consumer user guide 2020-06-01 18:59:14 +06:00
Asif Saif Uddin (Auvi) 3907e87507 v 4.6.9 2020-06-01 13:53:39 +06:00
Asif Saif Uddin (Auvi) 913d64030b update changelog for 4.6.9 2020-06-01 13:52:52 +06:00
Asif Saif Uddin (Auvi) 6277a7fe54 update changelog 2020-06-01 13:31:16 +06:00
Asif Saif Uddin 9bb628a301 update pyamqp 2020-06-01 13:06:34 +06:00
Matus Valo df31de1c6e Fix broken compatibility with Celery 2020-06-01 12:56:32 +06:00
Matus Valo 25a0266651 Ensure connection when connecting to broker 2020-06-01 12:56:32 +06:00
Ihar Nauros 5cc4a76882
Fix for issue #1198: Celery crashes in cases where there aren’t enough available workers to start acting on “in-flight” messages in the SQS queue (#1199)
* Fix for the issue #1172

* Unit test for the fix relating to the issue #1172

* Fix for issue #1198: Celery crashes in cases where there aren’t enough available workers to start acting on “in-flight” messages in the SQS queue

* Fix for issue #1198: fixed lint issues

* Fix for issue #1198: added unit tests

Co-authored-by: inauros <inauros@copyright.com>
2020-05-27 16:18:31 +06:00
Oleh Kuchuk 246cb9e996
Fix connection imaybe_declare (#1196) 2020-05-26 21:03:22 +02:00
Matus Valo 4644a5e940
Revert "Raise RecoverableConnectionError in maybe_declare with retry on and dropped connection" (#1195)
This reverts commit 90f51bcbbd.
2020-05-25 00:06:38 +02:00
Antoine Busque 91d4ef0a1d Fix: eliminate remaining race conditions from SQLAlchemy Channel
Although a race condition in the SQLAlchmey Channel class was fixed in
a recent commit [0], a few other methods are also susceptible to race
conditions.

Indeed, if multiple threads call the class' `_open` method, a conflict
can occur with the `metadata.create_all` call which creates the schema
in the database, resulting in an exception which can look like this:

```
sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation)
duplicate key value violates unique constraint
"pg_type_typname_nsp_index" DETAIL: Key (typname,
typnamespace)=(queue_id_sequence, 2200) already exists.
```

Similarly, `_get_or_create` is susceptible to a race condition if two
threads try to create the unique queue object in the database at the
same time, resulting in this kind of exception:

```
sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation)
duplicate key value violates unique constraint "kombu_queue_name_key"
DETAIL: Key (name)=(celery) already exists.

[SQL: INSERT INTO kombu_queue (id, name) VALUES
(nextval('queue_id_sequence'), %(name)s) RETURNING kombu_queue.id]
[parameters: {'name': 'celery'}]
```

By using the mutex, we can ensure that only one thread at a time
executes these critical sections, eliminating the race conditions.

The mutex has been made re-entrant since `_open` can be called from
`_get_or_create`, which would cause a deadlock if a simple `Lock` was
used instead of `RLock`.

[0] 8f1de37a08

Signed-off-by: Antoine Busque <antoinebusque@gmail.com>
2020-05-17 16:24:40 +06:00
Vinay Karanam 7fefb6fe9a Modified Mutex to use redis LuaLock implementation
Fixes #1190
2020-05-17 11:15:19 +06:00
Matus Valo c9451787be Fix flake8 2020-05-15 23:30:55 +02:00
Matus Valo 963819dd73 Improve integration test suit 2020-05-15 17:08:29 +02:00
Andrii Maletskyi 5101db177c fix 100% cpu usage on linux while using sqs
fix https://github.com/celery/celery/issues/5299
2020-05-15 07:11:01 +06:00
Matus Valo e316313222 Improved Priority integration tests 2020-05-13 08:59:57 +02:00
Matus Valo bfe73b597c Fix flake8 2020-05-12 22:18:22 +02:00
Matus Valo e0c27f3cfe Added priority integration tests for Redis 2020-05-12 09:56:04 +02:00
Matus Valo 0d3b1e254f Added integration tests for priority queues 2020-05-08 11:32:46 +02:00
Matus Valo 5113df342e Added TTL integration tests 2020-05-06 14:36:21 +02:00
Matus Valo 5d55eba3ec Added Integration tests for direct, topic and fanout exchange types 2020-05-06 08:42:41 +02:00
AaronKable 90f2afb631 Fix Consumer Encoding 2020-05-06 11:25:28 +06:00