summaryrefslogtreecommitdiff
path: root/kombu
Commit message (Collapse)AuthorAgeFilesLines
* Return empty list instead of InconsistencyError when exchange table is emptyMatus Valo2021-10-251-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Missing redis key containg set of queues bound to queue is caused by removal all queues from the exchange. Hence, we should not raise an exception but just return empty list of queues instead. This commit fixes e.g. case publishing message against empty exchange: import kombu conn = kombu.Connection('redis://') exchange = kombu.Exchange('name', type='direct') exchange.declare(channel=conn.default_channel) producer = conn.Producer() producer.publish( {'hello': 'world'}, exchange=exchange, routing_key='queue1' ) But it also fixes the case when last queue is unbound from exchange and after publishing to this exchange: import kombu conn = kombu.Connection('redis://') exchange = kombu.Exchange('name', type='direct') queue1 = kombu.Queue('queue1', exchange=exchange, routing_key='queue1') exchange.declare(channel=conn.default_channel) queue1 = queue1.bind(channel=conn.default_channel) queue1.declare() producer = conn.Producer() producer.publish( {'hello': 'world'}, exchange=exchange, routing_key='queue1' ) queue1.delete() producer.publish( {'hello': 'world'}, exchange=exchange, routing_key='queue1' )
* fix flake8 in kombu/asynchronous/aws/connection.py (#1397)Matus Valo2021-10-051-1/+1
| | | | | | | | | * fix flake8 in kombu/asynchronous/aws/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>
* Prevent caching of oid in pidbox (#1394)Matus Valo2021-10-051-8/+2
| | | | | | | | | | | | oid is not cached anymore due race conditions of oid in celery. Caching oid is causing following exception: OperationalError(" Cannot route message for exchange 'reply.celery.pidbox': Table empty or key no longer exists. Probably the key ('_kombu.binding.reply.celery.pidbox') has been removed from the Redis database. ",) This exception seems to be occuring when multiple celery workers contains same oid.
* [pre-commit.ci] pre-commit autoupdate (#1393)pre-commit-ci[bot]2021-09-274-7/+6
| | | | | | | | | | | | * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/pyupgrade: v2.26.0 → v2.28.0](https://github.com/asottile/pyupgrade/compare/v2.26.0...v2.28.0) * [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>
* Fix: check redis response typekaiix2021-09-161-1/+1
|
* Merge branch 'master' of https://github.com/celery/kombuAsif Saif Uddin2021-09-071-1/+1
|\
| * v 1.4.x (#1338)Asif Saif Uddin2021-09-071-1/+1
| | | | | | | | | | * v 1.4.x
* | Bump version: 5.1.0 → 5.2.0rc1v5.2.0rc1Asif Saif Uddin2021-09-071-1/+1
|/
* Make BrokerState Transport specificMatus Valo2021-08-304-6/+19
|
* fix: add missing commands to prefixGábor Boros2021-08-271-4/+5
| | | | | | Add missing DEL, RPUSH, RPOP and SREM commands to the list of commands to prefix. Also, this commit refactors the prefixing logic a bit to make it simpler.
* fix: raise BrokenPipeError (#1231)Steven2021-08-261-0/+4
| | | | Co-authored-by: Steven Joseph <steven@pointzi.com> Co-authored-by: Steven Joseph <steven@stevenjoseph.in>
* Add global key prefix for keys set by Redis transporter (#1349)Gábor Boros2021-08-251-1/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Introduce global key prefix for redis transport Co-authored-by: Matus Valo <matusvalo@users.noreply.github.com> * refactor: use a custom redis client As per the suggestions, refactor the redis key prefixing to use a custom redis client that prefixes the keys it uses. The custom client implementation does not prefix every key by default as the way of prefixing keys may differ for some redis commands, instead it lists those keys that will be prefixed. In case of commands, where multiple keys can be passed as an argument, the custom client defines where the arg positions are starting and ending for the given command. * test: fix unit tests by moving import statement * fix: wrap redis.parse_response to remove key prefixes Co-authored-by: Matus Valo <matusvalo@users.noreply.github.com> * fix: typo * fix: lint Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu> Co-authored-by: Matus Valo <matusvalo@users.noreply.github.com> Co-authored-by: Jillian Vogel <jill@opencraft.com>
* SQS Channel.predefined_queues should be `{}` if not definedBrad Smith2021-08-211-1/+1
| | | | Previously, calling `reject` when `predefined_queues` was not configured would cause `AttributeError` to be raised from `_extract_backoff_policy_configuration_and_message`. That exception could crash the whole Celery worker and force it to exit early because `AttributeError` is not excepted in the nearby call stack.
* Fixed type commentSchizmOne2021-08-211-2/+2
|
* Use Python's built-in json module by default, instead of simplejsonnikolas2021-08-141-6/+6
| | | Only use simplejson if it's absolutely necessary - Python's built-in json module is better if it's available.
* Use hostname from URI when server_host is NoneMatus Valo2021-08-052-1/+41
|
* enable pre-commit (#1355)Thomas Grainger2021-07-2050-185/+159
| | | | | | | | | | | | | | | | | | | * enable pre-commit * use extend-ignore for flake8 * manual flake8 fixes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update kombu/__init__.py Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Update docstrings of redis transport with user and passwordMatus Valo2021-07-081-3/+3
|
* Add support for setting redis username (#1351)Gábor Boros2021-07-081-1/+3
| | | | | * feat: add support for setting redis username * tests: add redis connparams credentials tests
* Make flake8 happyMatus Valo2021-06-091-5/+10
|
* Small fixes in documentationMatus Valo2021-06-092-12/+6
|
* Remove backward compatible code not used anymore (#1344)Matus Valo2021-05-256-67/+23
| | | | | * Fix broken nested() after #1320 * Remove backward compatible code not needed anymore
* Fix version replacement.Omer Katz2021-05-231-1/+1
|
* Bump version: 5.1.0b1 → 5.1.0Omer Katz2021-05-231-1/+1
|
* prepare_accept_content() now raises SerializerNotInstalled instead of ↵Matus Valo2021-05-231-1/+11
| | | | | | | KeyError (#1343) * Fix broken nested() after #1320 * prepare_accept_content now raises SerializerNotInstalled when wrong serializer alias is passed
* add accept parameter to SimpleQueue class (#1140)Luis Saavedra2021-05-221-4/+4
| | | | | | | | | | | | | * add accept parameter to SimpleQueue class * Fixed missing accept for get_nowait() and added unittests * Remove unused **kwargs from SimpleQueue.__init__ * Use self.consumer.accept instead of new attribute in SimpleQueue * Add tests for simple interface when accept=[] Co-authored-by: Matus Valo <matusvalo@gmail.com>
* Revert "chore: Refactor code quality issues (#1320)" (#1342)Matus Valo2021-05-192-2/+5
| | | This reverts commit 3b6cd13d3b6da22f86a23b93b66c49133776cc75.
* chore: Refactor code quality issues (#1320)Aksh Gupta2021-04-282-5/+2
| | | | | * chore: refactor code quality issues * remove .deepsource.toml config file
* Make flake8 and pydocstyle happy (#1333)Matus Valo2021-04-136-94/+178
| | | | | * Make flake8 happy * Make pydocstyle happy
* Coerce seconds argument to a floating point number.Omer Katz2021-04-131-1/+1
| | | | | Celery does not coerce configuration values into the right type (See celery/celery#6696). This is a workaround. This bug will be fixed in Celery NextGen when we will refactor our configuration subsystem.
* Add support for SQLAlchemy 1.4. (#1328)Omer Katz2021-04-061-1/+6
|
* Azure Service Bus - versatile queue names fix (#1324)Tomasz Niedziela-Brach2021-04-041-1/+3
| | | | | | | | | * fixed character replace table according to the comment above - dots replaced by dashes, other punctuations replaced by underscores * optimised with precalculated punctuation set - according to @thedrow suggestion * queue name tests * cleanup
* Bump version: 5.0.2 → 5.1.0b1v5.1.0b1Asif Saif Uddin (Auvi)2021-04-011-1/+1
|
* Use a thread-safe implementation of cached_property (#1316)Omer Katz2021-04-011-47/+37
| | | | | | | | | | | | | * Use a thread-safe implementation of cached_property. * Restore setter and deleter. * Restore tests. * Fix __get__ signature for backport. * Cleanup. Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
* SQS Broker - handle STS authentication with AWS (#1322)gal cohen2021-03-291-15/+57
| | | | | | | | | | | | | | | | | | | | | * handle sqs sts * add doc * use string format * improve docs * Update kombu/transport/SQS.py Co-authored-by: Omer Katz <omer.drow@gmail.com> * add helper method and tests * changer to private Co-authored-by: galcohen <gal.cohen@autodesk.com> Co-authored-by: Asif Saif Uddin <auvipy@gmail.com> Co-authored-by: Omer Katz <omer.drow@gmail.com>
* Update default login method for librabbitmq and pyamqp (#936)Davis Kirkendall2021-03-242-2/+2
| | | - AMQPLAIN is only retained for backwards compatability and has become non-standard
* Drop obsolete code importing pickle (#1315)Illia Volochii2021-03-161-7/+1
| | | | | https://docs.python.org/3.9/whatsnew/3.0.html#library-changes > A common pattern in Python 2.x is to have one version of a module implemented in pure Python, with an optional accelerated version implemented as a C extension; for example, pickle and cPickle. This places the burden of importing the accelerated version and falling back on the pure Python version on each user of these modules. In Python 3.0, the accelerated versions are considered implementation details of the pure Python versions. Users should always import the standard version, which attempts to import the accelerated version and falls back to the pure Python version. The pickle / cPickle pair received this treatment.
* Drop support for the lzma backport.Omer Katz2021-03-161-13/+7
|
* Update connection.py (#1311)Krogsager2021-03-151-1/+6
| | | | | Based on my headaches with silent revert to `localhost` I submit this PR. The developer should be notified if their host settings are not found. Details on the issue are here: https://github.com/celery/celery/issues/6661
* Update default pickle protocol version to 4 (#1314)Illia Volochii2021-03-151-3/+2
| | | | | Protocol version 4 was added in Python 3.4 and is supported by all Python versions that kombu supports. https://docs.python.org/3.9/library/pickle.html#data-stream-format
* fix: non kombu json message decoding in SQS transport (#1306)Max Nikitenko2021-03-071-2/+12
| | | | | | | * fix: non kombu json message decoding in SQS transport * fix: non kombu json message decoding in SQS transport - add tests Co-authored-by: Max Nikitenko <max.nikitenko@namecheap.com>
* Revert "Port of redis code improvements from prior revision (#1132)" (#1307)Matus Valo2021-03-061-16/+13
| | | This reverts commit 753f4ec174916f9c4c38c52cbf73a49cf66bad29.
* Port of redis code improvements from prior revision (#1132)Matt Davis2021-03-031-13/+16
| | | | | | | | | | | | | * Port of redis code improvements from prior revision Add fakeredis requirement * refine variable naming based on PR feedback. * Remove python2 code style and remove unittest.Testcase from test_redis.py * Code refactor of redis.py and test_redis.py Co-authored-by: Matus Valo <matusvalo@gmail.com>
* SQS back-off policy (#1301)gal cohen2021-03-022-1/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sqs retry policy * add test * method definition * add validation * rename policy * add kombu doc * improve docstring * add test and doc * test fix * test fixes * add doc * Update docs/reference/kombu.transport.SQS.rst Co-authored-by: Omer Katz <omer.drow@gmail.com> * Update docs/reference/kombu.transport.SQS.rst Co-authored-by: Omer Katz <omer.drow@gmail.com> * Update kombu/transport/SQS.py Co-authored-by: Omer Katz <omer.drow@gmail.com> * Update kombu/transport/SQS.py Co-authored-by: Omer Katz <omer.drow@gmail.com> * Update kombu/transport/SQS.py Co-authored-by: Omer Katz <omer.drow@gmail.com> * review improvements * improvements * add improvements * rename Co-authored-by: galcohen <gal.cohen@autodesk.com> Co-authored-by: Omer Katz <omer.drow@gmail.com> Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
* Disable namedtuple to object feature in simplejson (#1297)Choi Geonu2021-03-011-1/+4
|
* kombu/asynchronous/http/curl: implement _set_timeoutraittes2021-02-121-1/+1
|
* Fix issues with parsing URL with an extra / in it.Terry Cain2021-01-063-17/+85
|
* Allow specifying session token (#1283)Philipp A2021-01-051-3/+14
| | | | | | | * Allow specifying session token * add docs * add comment
* Support for Azure Service Bus 7.0.0 (#1284)Terry Cain2021-01-041-74/+221
| | | | | * Started servicebus refactor * Cleaned up, handle service bus SAS token parsing
* docs: fix simple typo, propery -> propertyTim Gates2020-12-281-1/+1
| | | | | | There is a small typo in kombu/asynchronous/http/base.py. Should read `property` rather than `propery`.