Bird
0
0

Why does AsyncResult.status sometimes return 'PENDING' even if the task was sent to the broker?

hard📝 Conceptual Q10 of 15
Django - Celery and Background Tasks
Why does AsyncResult.status sometimes return 'PENDING' even if the task was sent to the broker?
ABecause the task result backend has not received any update yet
BBecause the task ID is invalid
CBecause the broker is down
DBecause the task has already finished
Step-by-Step Solution
Solution:
  1. Step 1: Understand status flow in Celery

    When a task is sent, the broker queues it, but the result backend may not have updated status yet.
  2. Step 2: Explain why status shows PENDING

    Until the backend receives a status update, AsyncResult.status returns 'PENDING' even if the task is queued.
  3. Final Answer:

    Because the task result backend has not received any update yet -> Option A
  4. Quick Check:

    PENDING means no backend update yet [OK]
Quick Trick: PENDING means no result backend update yet [OK]
Common Mistakes:
MISTAKES
  • Assuming PENDING means invalid task ID
  • Thinking broker down causes PENDING status
  • Confusing PENDING with finished task

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes