Skip to content

Scheduler log spam: broker mismatch between AsyncSharedBroker and Redis ListQueueBroker #455

Open

Description

@Bohdan-Ilchyshyn

While running a Taskiq scheduler that uses taskiq_redis.redis_broker.ListQueueBroker, the worker constantly prints warnings like the following for every scheduled tick:

Broker for taskiq_pipelines.shared.filter_tasks <taskiq.brokers.shared_broker.AsyncSharedBroker object at 0xfef8d4d6b8c0> doesn't match scheduler's broker <taskiq_redis.redis_broker.ListQueueBroker object at 0xfef8d42606e0>
Broker for taskiq_pipelines.shared.wait_tasks   <taskiq.brokers.shared_broker.AsyncSharedBroker object at 0xfef8d4d6b8c0> doesn't match scheduler's broker <taskiq_redis.redis_broker.ListQueueBroker object at 0xfef8d42606e0>

Tasks still run, but the log noise is severe and suggests something is mis-configured

My code:

REDIS_CONNECTION_KWARGS = {
    'retry': Retry(ExponentialBackoff(), retries=3),
    'retry_on_error': [BusyLoadingError, ConnectionError, TimeoutError],
    'max_connection_pool_size': 100,
}

result_backend = RedisAsyncResultBackend(
    redis_url=settings.redis_url, **REDIS_CONNECTION_KWARGS
)
broker = ListQueueBroker(
    url=settings.redis_url, queue_name='taskiq-default', **REDIS_CONNECTION_KWARGS
)
broker.with_result_backend(result_backend=result_backend)
broker.with_middlewares(LoggingMiddleware(), PipelineMiddleware())
scheduler = TaskiqScheduler(
    broker=broker,
    sources=[LabelScheduleSource(broker)],
)

taskiq_fastapi.init(
    broker,
    'src.web.application:get_app',
)

Lib versions:

taskiq-dependencies==1.5.7 ; python_version == "3.12"
taskiq-fastapi==0.3.4 ; python_version == "3.12"
taskiq-pipelines==0.1.4 ; python_version == "3.12"
taskiq-redis==1.0.2 ; python_version == "3.12"
taskiq==0.11.13 ; python_version == "3.12"

Activity

  1. tuktamyshev commented on Apr 23, 2025

    @tuktamyshev

    Hi, I had the same problem recently and i solved it #454 but I still think it should be fixed to work in another way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions