Commit Graph

3091 Commits

Author SHA1 Message Date
Alexey Popravka 9b0694f4ed fix close of shared redis socket causing celery to hang (#954) 2018-11-22 14:42:36 +06:00
Jeppe Fihl-Pearson 5fca408a91 Correct order of Redis `zadd` dict elements (#953)
The changed `zadd()` behaviour in redis-py 3 states:
https://github.com/andymccurdy/redis-py#mset-msetnx-and-zadd

> For ZADD, the dict is a mapping of element-names -> score.

So the dictionary generated for `zadd()` should be flipped around to have the
`delivery_tag` as the key and the score as value. This commit fixes that.
2018-11-20 15:27:38 +02:00
Victor Villas 4a06fc6bb8 Add boto3 default region before hardcoded default (#951)
* Add boto3 default region before hardcoded default

* Add unit tests for SQS region default behavior

* Import boto3 only inside the test

The library may not be available
2018-11-20 16:15:31 +06:00
Omer Katz 71c0d0a34b
Revert "Pin Redis-py version (#946)" (#952)
This reverts commit d9de66bd4e.
2018-11-19 19:34:08 +02:00
Ash Berlin-Taylor 05152da53d Support redis-py v2 and v3 (#948)
Further to #946 this fixes the underlying issue in a easy-to-upgrade way
for end users, many of whom will have Redis installed via other means.
By having this check here and supporting both versions concurrently it
makes it easier for end users, and to use celery/kombu in projects that
use Redis elsewhere.

With this change it is possibly worth reverting #946
2018-11-19 19:33:50 +02:00
Ash Berlin-Taylor d9de66bd4e Pin Redis-py version (#946)
Redis-py 3.0.0 was released today and introduced a backwards incompatible changes.

9b03af26dc/CHANGES (L27-L29)

This isn't the "best" fix but is the quickest
2018-11-15 19:10:34 +02:00
Mads Jensen 5e6fcca8d4 Used a tuple instead of a list to define __all__. (#945) 2018-11-12 16:05:58 +02:00
Noah Hall 84227ec503 disambiguate docstring typehints causing warnings building celery docs (#941) 2018-11-01 22:37:59 +06:00
Mads Jensen 0148e7102d Enabled Python 3.7 testing on AppVeyor. (#939) 2018-11-01 22:33:38 +06:00
Mads Jensen bb6d16c28d Removed Jython bz2 import fallback (#938) 2018-10-28 19:05:18 +02:00
Kyle Verhoog 110dc10cbc Replace README web link with link to documentation (#935) 2018-10-19 21:39:42 +06:00
Mintu Kumar Sah 94227bbc43 Fixed Worker shutdown creates duplicate messages in SQS broker (#926)
* On restore changes message visibility instead of send new message

* Acknowledge message on hub close

* Use sqs instead of async sqs to delete message

* changes itertools to range

* Empty Hub ready

* fixed test_poller_regeneration_on_access

* Fixed typo in comment

* Simplify loop to process self._ready

* Added test case for redelivered _put

* Lint fixes

* Added test case for delete_message call
2018-10-13 16:22:16 +06:00
Asif Saif Uddin 0af7519f98
fixed deprecation warning (#927) 2018-10-07 21:14:21 +06:00
Vsevolod Strukchinsky b3dc920883 Fix infinity loop in create_loop (#923) 2018-09-27 21:38:21 +06:00
Bruno Alla 62087a67cf Fix a deprecation warning about logger.warn() (#924)
* Fix a deprecation warning about logger.warn()

This fixes a deprecation warning from the standard library's logging module:

> The 'warn' method is deprecated, use 'warning' instead

* Update test
2018-09-27 19:12:44 +06:00
Asif Saif Uddin 5f9261d125
added retry=True (#920) 2018-09-26 15:17:06 +06:00
Jon Dufresne 942a6daba9 Correct capitalization of PyPI (#919)
As spelled on https://pypi.org/.
2018-09-17 07:49:47 +06:00
Asif Saif Uddin (Auvi) ddb0c8ffad
Jython (#915)
* drop jython from tox

* drop jython from setup.py
2018-09-05 18:42:04 +06:00
Clemens Wolff 32633554ac Add transports based on Azure PaaS (#891)
* Add transports based on Azure PaaS

This pull request adds two new transport implementations:

- `azurestoragequeues` is implemented on top of Azure Storage
  Queues [1]. This offers a simple but scalable and low-cost PaaS
  transport for Celery users in Azure. The transport is intended to be
  used in conjunction with the Azure Block Blob Storage backend [2].

- `azureservicebus` is implemented on top of Azure Service Bus [3] and
  offers PaaS support for more demanding Celery workloads in Azure. The
  transport is intended to be used in conjunction with the Azure
  CosmosDB backend [4].

This pull request was created together with @ankurokok, @dkisselev,
@evandropaula, @martinpeck and @michaelperel.

[1] https://azure.microsoft.com/en-us/services/storage/queues/
[2] https://github.com/celery/celery/pull/4685
[3] https://azure.microsoft.com/en-us/services/service-bus/
[4] https://github.com/celery/celery/pull/4720

* Exclude Azure transports from code coverage

There is test coverage for the transports but the tests require Azure
credentials to run (passed via environment variables) so codecov doesn't
exercise them.

* Remove env vars to configure transport

* Remove abbreviations
2018-08-30 23:34:52 +06:00
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 b59bf1b679
Added Python 3.7 to the build matrix (#908)
* Run tests with Python 3.7.

* Add missing dependencies.

* Show skip reasons.

* Add more dependencies to CI tests.

* Fix requirements.
2018-08-16 07:53:25 -05: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
Mikhail Shcherbinin 0c740a7b58 Index in sqlalchemy transport for quick sorting (#850) 2018-08-09 16:50:53 +03:00
Matt Yule-Bennett e2a59094c2 don't cache declaration of expiring queues (#884) 2018-08-09 16:49:34 +03:00
Asif Saifuddin Auvi baf488bdaf
Added python 3.7 to classifier 2018-06-28 18:44:01 +06:00
Jon Dufresne 675216fe98 Update pypi.python.org URL to pypi.org (#893) 2018-06-27 19:52:45 +06:00
程飞 080502fd5c fix librabbitmq link error (#889) 2018-06-13 13:55:51 +03:00
Jon Dufresne cb516bbf74 Update all pypi.python.org URLs to pypi.org (#885)
For details on the new PyPI, see the blog post:

https://pythoninsider.blogspot.ca/2018/04/new-pypi-launched-legacy-pypi-shutting.html
2018-06-10 16:40:04 +06:00
Omer Katz c627c6d9d1
Bump version: 4.2.0 → 4.2.1 2018-05-30 17:07:29 +03:00
Omer Katz 736d1909ba
Updated changelog. 2018-05-30 17:07:24 +03:00
Sławomir Ehlert 25cafc4f5f Remove data_files from setup.py (#882)
Fixes #881

Also add some blank lines for pep-8 compatibility
2018-05-30 16:18:13 +03:00
Omer Katz e8e92af89e
Bump stable version for docs. 2018-05-28 16:57:51 +03:00
Omer Katz e7fee62836
Ignore .pytest_cache. 2018-05-28 16:57:51 +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
Omer Katz b975713d81
Bump version: 4.1.0 → 4.2.0 2018-05-21 08:48:16 +03:00
Omer Katz 3bc949d63a
Actually run linters first. 2018-05-20 11:33:02 +03:00
Omer Katz e824ba1b96
Cleaned up redundant call of PY3 constants. (#869) 2018-05-20 11:28:56 +03:00
Omer Katz b5ef2d7571
Run linters first in CI. 2018-05-20 11:12:16 +03:00
Omer Katz c1351f59df
Use pytest-sugar for output. 2018-05-20 11:02:41 +03: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
Asif Saifuddin Auvi 824491b972
Cleaned up redundant PY3 constants (#854)
* Cleaned up redundent PY3 constants in utils/encoding

* Cleaned up redundent PY3 constants in utils/json

* fixed flake8 error
2018-04-29 22:01:35 +06:00
Alex Hill 0f6ef8c90b Update Changelog for 4.2.0 (#848)
I've gone through the commits since the last tag and added them, grouping the minor tweaks/fixups and doc changes. I think I've got everything.

Incidentally I've left a question in #689 but that needn't prevent release.
2018-04-16 16:39:06 +06:00
Jon Dufresne c9ea79f0f9 Pass python_requires argument to setuptools (#847)
Helps pip decide what version of the library to install.

https://packaging.python.org/tutorials/distributing-packages/#python-requires

> If your project only runs on certain Python versions, setting the
> python_requires argument to the appropriate PEP 440 version specifier
> string will prevent pip from installing the project on other Python
> versions.

https://setuptools.readthedocs.io/en/latest/setuptools.html#new-and-changed-setup-keywords

> python_requires
>
> A string corresponding to a version specifier (as defined in PEP 440)
> for the Python version, used to specify the Requires-Python defined in
> PEP 345.
2018-04-12 17:31:53 +06:00