Commit Graph

70 Commits

Author SHA1 Message Date
Daniel Blair 200a60a228 Add support for 'rediss' scheme for secure redis connections. (#910)
Putting a 'rediss'-specific check into a generic connection module feels
like a code smell but there doesn't appear to be another way to intercept
the connection initiation code. It defaults to the least secure form, as
there is no suitable default location for `ca_certs`. The recommendation
would still be to follow the documentation and specify `broker_use_ssl` if
coming from celery.
2018-08-27 13:26:07 +03:00
Omer Katz 6939d93d7f
Added tests that verify that librabbitmq is selected when available and not selected when it is not available. (#907) 2018-08-16 04:48:33 -05:00
C Blue Neeh 9e64dafa61 Allow SimpleQueue to pass 'queue_arguments' to Queue object. (#900)
* Update SimpleQueue for queue_arguments passing

Allow SimpleQueue to pass queue_arguments to Queue object.

This allows SimpleQueue to connect to RabbitMQ queues with custom arguments like 'x-queue-mode'='lazy'.

* Missed indent

* remove trailing space

* add 'queue_args' to arguments (and documentation) for SimpleQueue

Signed-off-by: Blue Cuenca <blue.cuenca@gmail.com>

* add test to verify new argument 'queue_args'.

Signed-off-by: Blue Cuenca <blue.cuenca@gmail.com>
2018-08-16 04:00:50 -05:00
gal cohen a307726faa on worker restart - restore visible regardless to time (#905)
* on worker restart - restore visiable regardless to timme

* add test

* rename test

* rename test

* pep8

* flake8
2018-08-15 17:12:45 +06:00
KUAN Hsuan-Tso 87d6423289 fix/Broadcast-fail-by-give-queue-kwargs (#906)
* If give queue kwargs broadcast will fail

Because give Broadcast(name='xxx', queue='xxx'),
it will create one specific name for queue,
and if launch more worker for consuming this queue,
this specific name queue already exist then it will not create new queue to
binding fanout exchange.
So all worker will consuming same queue, and exchange only binding this
queue then lose the effect of broadcasting.

* modify test_Broadcast
2018-08-15 16:59:33 +06:00
Antonio Gutierrez 1160b92c27 Queue: add handling of Exchange as str to constructor (#904)
To fit with the documentation, Queue can now handle a str argument for
the exchange parameter in the constructor, as well as an actual Exchange
object.
Added relevant unit tests to avoid regressions.

Fixes: https://github.com/celery/kombu/issues/903

Signed-off-by: Antonio Gutierrez <chibby0ne@gmail.com>
2018-08-12 08:59:27 +06:00
Alan Justino da Silva 073001e341 "Reentrant" version, that allows a `celery.bin.celery.main` worker to run multiple times (#866)
* Regenerate poll()s of Hub and Redis, after shutdown

Allows the same Python process to bring a new Worker
after a shutdown (SystemExit) rescued.

See: https://botbot.me/freenode/celery/2018-04-16/?msg=99046233&page=2

* Hub.poller is now a @property

* Fixed tests that supose .poller to be settable to None

* Test hub.pooler regeneration

* No need to regenerate poller on Redis if the Hub behaves nicely
2018-08-10 17:42:50 +06:00
tothegump 152923594f Add timeout to retry_over_time (#880)
add ut
2018-08-09 16:55:30 +03:00
Matt Yule-Bennett e2a59094c2 don't cache declaration of expiring queues (#884) 2018-08-09 16:49:34 +03:00
Bryan Shelton b0512725f6 Handle librabbitmq fileno socket not connected raising ValueError (#878)
* Handle librabbitmq fileno socket not connected raises ValueError

* Test client objects set to None

* Assert that librabbitmq's conn.fileno is called
2018-05-27 20:54:37 +06:00
Asif Saifuddin Auvi 629879b422
clened up redundant call of PY3 constants (#856) 2018-04-30 00:20:05 +06:00
Asif Saifuddin Auvi 491d7f389b
used unittest and remove unittest2 (#855) 2018-04-29 23:46:59 +06:00
Alex Hill f246a66bed Prevent spurious exception on Resource.resize(0) (#826)
* Prevent spurious exception on Resource.resize(0)

`Resource.resize()` raises an exception if the pool is in use and the new size is smaller than the old size. However, it also raises this exception when the new size is zero, which should correspond to disabling the pool. Instead of shrinking the pool to zero and releasing all resources, we can simply dequeue all resources and forget about them.

* Add test for removing pool limit when in use
2018-04-08 12:06:02 +06:00
Thomas Achtemichuk 75695205f6 Rename `async` keyword to `asynchronous` (#839)
* Rename `async` keyword to `asynchronous`

* Fixes #742
* Resolves "DeprecationWarning: 'async' and 'await' will become reserved
  keywords in Python 3.7"

* Address PR feedback

* Update appveyor config

* Rename docs and tests
2018-03-19 19:28:43 +02:00
John Koehl 39e733c143 Fixes #791 - SQS queue name gets mangled in Python 2.7 environment (#794)
* Fixes #791

* Changing to recommended patch by @georgepsarakis

* Revert "Fixes #791"

This reverts commit 5593505dd9.

* Updated to make tests pass

* Made _ensure_str a private function

* Code formatting for flake8

* Added a mock of the newstr and newbytes classes to create a failing test that simulates the issue with using python-future under 2.7.
2018-01-28 09:21:05 +02:00
Mads Jensen c13d91634d Removed an always true if-check in t/integration/transport.py (#827) 2018-01-27 11:22:49 +02:00
Arcadiy Ivanov 2f9eb53128 Virtual transport timeout does not supesede period polling (#689)
fixes #688
2018-01-13 22:39:34 +06:00
dust8 e209fa6f84 Fixed ValueError caused by mongodb rc version: invalid literal for in… (#816)
* Fixed ValueError caused by mongodb rc version: invalid literal for int () with base 10

* add test fix ValueError caused by mongodb rc version
2018-01-13 20:52:52 +06:00
Omer Katz 3a7cdb07c9
Make flake8 happy. 2017-12-17 12:15:42 +02:00
Mads Jensen 65d203c71e Prefer dict literal syntax over dict() (#787)
* Prefer dict literal syntax over dict()

* An overlooked dict-constructor in transport/SQS.py
2017-09-08 07:43:59 +03:00
David Davis 2a161a4408 Make messages durable by default in qpid (#785)
We were seeing messages disappear in durable queues when restarting
qpid. This coincides with the rabbitmq code (e.g. https://git.io/v7jNV).
2017-08-20 14:32:10 +03:00
Anthony Lukach 0f4da8d450 Pass connection options from broker_options to default_channel (#769)
* Pass connection options from broker_options to default_channel (fixes #765)

* Fixup

* Fixup
2017-08-02 12:06:47 +03:00
Anthony Lukach b1e6fa5bb1 Fix SQS requests and response handling (#754)
* Fix SQS requests and response handling

* Accurately portray empty message response
2017-07-17 18:22:40 +03:00
Gabriel Amram b2f2128928 Fix infinite loop in create_loop (#760)
* Fix infinite loop in create_loop

fixes https://github.com/celery/celery/issues/3712 

Before handling the todo items we "freeze" them by copying them aside and clearing the list.
This way if an item in the todo list appends a new callable to the list itself it will be taken care of in the next iteration of the parent loop instead of producing an infinite loop by adding it to the list we're running on.

* Changed the test to be aligned with the new implementation

* passing flake8

* Avoid copying results with each iteration of the async loop.

* Pop instead of slicing.

* fixed: todos -> todo, fixed test to use MagicMock so we can use the len() method

* MagicMock not supported in 2.7, implemented __len__ on Mock instead

* added entry to changelog
2017-07-10 21:21:49 +03:00
Mikhail Elovskikh ba873ba4f2 Fix readpreference option parsing in MongoDB transport (#751)
* Fix readpreference option parsing in MongoDB transport

* Update changelog
2017-06-08 22:41:15 +06:00
Amin Ghadersohi be79b3d4cd Re-Adding support for sqlalchemy as it is needed by Apache project Airflow (#687)
* Re-Adding support for sqlalchemy as it is needed by Apache project Airflow

* Re-Adding support for sqlalchemy as it is needed by Apache project Airflow
2017-05-17 14:17:47 +06:00
Anthony Lukach 25a9e76f3a Prevent SQS from defaulting to localhost hostname (#733)
* Prevent SQS from defaulting to localhost hostname

* Ensure cloned connection maintains NoneType hostname
2017-05-05 21:40:57 +06:00
George Psarakis da047e9c3b Parse password from Redis transport URL (#710) 2017-04-27 10:47:37 +03:00
George Psarakis 259ac2e2bf Add missing function import 2017-04-26 21:44:34 +03:00
George Psarakis a875363730 Test cases for generate_oid 2017-04-26 21:44:34 +03:00
Dima Kurguzov 221685618f Refactor chroot normalization 2017-04-21 19:29:21 +03:00
Dima Kurguzov 5f35ef996c Fix last chroot character trimming 2017-04-21 19:29:21 +03:00
Jon Dufresne f4fda3858f Remove print from tests; looks like it was left in from debugging (#719) 2017-04-17 10:24:00 +06:00
georgepsarakis 90149e4c5c PEP8 fix 2017-04-16 11:28:24 +03:00
georgepsarakis b701805cfc Re-enable unit tests and add case for endpoint URL property 2017-04-16 11:28:24 +03:00
Anthony Lukach 6c3bb07e19 Bugfix: Support Python 3.4, decode from base64 when converting messag… (#714)
* Bugfix: Support Python 3.4, decode from base64 when converting message to Python

* Use str_to_bytes
2017-04-14 23:43:06 +06:00
Mischa Spiegelmock 129a9e4ed0 Switching to boto3 only (#693)
* Switch Boto2 to Boto3 for SQS messaging

* Fixed region support

* Add SQS FIFO queue support

* Add sensible defaults for message attributes

* Asynchronous support, plus boto3 for region endpoint lookups

* Clean up imports

* Fix Python 2 support

* Fix receive_message tests

* Reformat docstring

* boto3 import changes for CI

* skip tests if boto3 not installed

* skip tests if boto3 not installed

* flake8

* noboto

* ditching boto2. got queue URL fetching, async HTTP request generation and signing working.

* request signing working kinda

* async parsing of SQS message response more or less working

* botocore sqs dep

* ripping out more old boto2 stuff

* removing tests that are no longer valid with boto3/SQS

* fix boto3 dep, min version and no botocore

* no boto2 for test

* cleaning up some SQS tests. fixing header parsing of response to msg

* fixing some sqs tests

* removing response-parsing tests that are no longer necessary as we're using the botocore response parsing machinery instead of implementing SAX parsing in kombu.

* fixing more SQS tests

* wants a region

* trying to fix py2 parsing of sqs message

* lint

* py2/py2 message header parsing stupidness

* forgot

* python 2 sux

* flake8

* Import boto3 from the right place

* Changes

* Update encode fuction

* Fix lint

* remove some unused things

* removing unused stuff

* ugh

* ugh

* ugh

* landscape ignoring

* shut up, landscape
2017-04-14 11:22:18 +06:00
Dima Kurguzov bf820b20b0 Fix byte string for kazoo.Queue in Python 3 (#713)
* Fix byte string for kazoo.Queue in Python 3

* Add test for message conversion to bytes in ZooKeeper channel
2017-04-12 11:24:04 +06:00
Jerry Seutter e2322998fc Fix a broken test in python 3 (#674) 2016-12-24 15:34:28 +06:00
Ask Solem 1464a2afbe Redis: Fixes priority tests 2016-12-08 17:06:12 -08:00
Ask Solem 5a028a6906 Fixes failing test case 2016-12-07 15:58:56 -08:00
Ask Solem 8a7ea091bf Consumer: __exit__ should not cancel if connection error (Closes #670) 2016-12-07 14:28:16 -08:00
Ask Solem e03cbbe0d8 Fixes Qpid tests 2016-12-07 14:25:49 -08:00
Ask Solem 4fd70fbda8 Fixes mongodb tests 2016-12-07 14:24:53 -08:00
Ask Solem f6b0e7267a flakes 2016-10-28 16:22:45 -07:00
Ask Solem a7fda57557 Try to fix test suite 2016-10-28 16:17:13 -07:00
Ask Solem 5946409b9c Fixes SQS tests 2016-10-28 16:07:19 -07:00
Ask Solem baeef7ac1a Ports Qpid unit tests to pytest 2016-10-28 15:46:25 -07:00
Ask Solem fb46262ee5 Signature of Message is now Message(body, channel=), not Message(channel, body=) 2016-10-27 16:55:40 -07:00
Ask Solem ded6f0c873 Entities can now be declared without binding to channel: entity.declare(channel=channel) 2016-10-27 14:22:19 -07:00