Skip to content

Conversation

@maccinza
Copy link
Contributor

Description

This PR adds a regression-style test to demonstrate that Celery falls back to creating a celery queue of type classic and an exchange of type direct, even when task_default_queue_type and task_default_exchange_type are explicitly set.

The test is marked with @pytest.mark.xfail(strict=True) to:

  • Document the current undesired behavior
    • celery exchange defaults to type "direct" (instead of task_default_exchange_type)
    • celery queue defaults to type "classic" (instead of task_default_queue_type)
  • Automatically surface if the behavior changes in future versions

Related Discussion

This issue was raised in the Celery GitHub discussion: #9742

Why it matters

When using quorum queues or non-direct exchanges (e.g. topic), users expect Celery to respect the configured defaults. This test makes the fallback behavior visible and prevents silent reintroduction if fixed upstream.

Fixing this likely involves changes in Kombu’s handling of default queue declarations when tasks are published without explicit routing.

maccinza added 2 commits June 17, 2025 17:51
…o routing is used

This test verifies that Celery currently ignores task_default_exchange_type
and task_default_queue_type for the default 'celery' queue/exchange, falling back
to 'direct' and 'classic' respectively.

Marked as xfail with strict=True to track future fix.
@codecov
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.47%. Comparing base (dd4cf64) to head (82f2d4b).
⚠️ Report is 43 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9765      +/-   ##
==========================================
- Coverage   78.52%   78.47%   -0.05%     
==========================================
  Files         153      153              
  Lines       19130    19130              
  Branches     2533     2533              
==========================================
- Hits        15021    15012       -9     
- Misses       3821     3826       +5     
- Partials      288      292       +4     
Flag Coverage Δ
unittests 78.45% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@auvipy auvipy requested a review from Copilot June 18, 2025 07:17

This comment was marked as outdated.

@maccinza maccinza marked this pull request as ready for review June 18, 2025 16:27
@Nusnus Nusnus self-requested a review June 18, 2025 16:28
@auvipy auvipy added this to the 5.5.4 milestone Jun 19, 2025
@auvipy auvipy requested review from auvipy and Copilot June 19, 2025 04:16

This comment was marked as outdated.

auvipy and others added 3 commits June 19, 2025 04:32
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Waits for both rabbit and redis ports

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@auvipy
Copy link
Member

auvipy commented Jun 25, 2025

We need to figure out to fix this intermittent issue later....

raise TimeoutError(f"Timeout of {timeout}s exceeded")
E pytest_docker_tools.exceptions.TimeoutError: Timeout of 60s exceeded

.tox/3.9-smoke/lib/python3.9/site-packages/pytest_docker_tools/utils.py:37: TimeoutError

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about increasing the timeout?

@maccinza maccinza requested a review from auvipy June 25, 2025 13:47
@auvipy auvipy merged commit de104a2 into celery:main Jun 25, 2025
233 of 235 checks passed
@auvipy auvipy modified the milestones: 5.5.4, 5.6.0 Jul 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants