* Warn about missing hostname only when default one is available
The `No hostname was supplied` warning is affecting projects that use
AWS SQS (as detailed in #1357), as a hostname is not required when
setting up the broker URL. Instead, the official documentation [0] specifies
that the valid broker URL formats are:
* `sqs://`
* `sqs://aws_access_key_id:aws_secret_access_key@`
With these formats, the `kombu.utils.url.parse_url` util doesn't return
a hostname, and workers end up triggering the following warning:
> No hostname was supplied. Reverting to default 'None'
As the SQS transport doesn't provide a default value for hostname, this
diff changes the behavior to only warn the user when the hostname hasn't
been supplied but a default one is being set by the default connection
parameters for the defined transport.
Fixes#1357.
[0] https://docs.celeryproject.org/en/stable/getting-started/backends-and-brokers/sqs.html#configuration
* Use caplog default logging level of WARNING
* allow getting recoverable_connection_errors without an active transport
* move redis transport errors to class
* move consul transport errors to class
* move etcd transport errors to class
* remove redis.Transport._get_errors and references in tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix flake8 errors
* add integration test for redis ConnectionError
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* 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>
* Add support for health_check_interval option in broker_transport_options. #1114
* Added Keivn Fox to authors.
* Do not use default arg for pop() method.
* Add dedicated test case for configurable health_check
* Add test case for when health_check_interval is not supported by connection_class in redis.
* Fix Flake8
* Added more test cases for redis.
* Updated tests.
* Add missing parameter queue_args in kombu.connection.SimpleBuffer
`queue_args` parameter was introduced in `kombu.simple.SimpleQueue`
class and at the same time in `kombu.connection.SimpleQueue` method.
However, `kombu.connection.SimpleBuffer` was not updated in the
same way.
As `kombu.connection.SimpleBuffer` is using positional arguments to
create a `kombu.simple.SimpleBuffer` object, `exchange_opts` value in
that instance would be None and `queue_args` is going to bet set with
the expected `exchange_opts` value.
* Add tests for SimpleBuffer and SimpleQueue
- Add tests for SimpleBuffer/SimpleQueue methods in kombu.simple module
- Add tests for SimpleQueue and SimpleBuffer tasks in kombu.connection
Prior to this change, one needed to specify a URL using a URI
identifier, e.g., `pyamqp://foo.bar`. This change makes it so calling
`.switch(..)` again results in switching the host, not switching the
resource identifier.
This simplifies setting up connections with just hostnames specifying
the resource identifier once, separately.
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>