Bird
0
0

In a Django app using Celery with Redis as broker, what happens if Redis server is down when a task is sent?

medium📝 component behavior Q5 of 15
Django - Celery and Background Tasks
In a Django app using Celery with Redis as broker, what happens if Redis server is down when a task is sent?
AThe task fails immediately with a connection error
BThe task is queued locally until Redis restarts
CThe task is silently dropped without error
DThe task runs synchronously in the main thread
Step-by-Step Solution
Solution:
  1. Step 1: Understand Celery behavior with Redis down

    Celery tries to connect to Redis broker; if Redis is down, connection error occurs immediately.
  2. Step 2: Evaluate other options

    Celery does not queue tasks locally or run them synchronously by default; tasks are not silently dropped.
  3. Final Answer:

    The task fails immediately with a connection error -> Option A
  4. Quick Check:

    Redis down causes immediate connection error in Celery [OK]
Quick Trick: Redis down causes immediate connection error in Celery [OK]
Common Mistakes:
MISTAKES
  • Assuming tasks queue locally without Redis
  • Thinking tasks run synchronously automatically
  • Believing tasks get silently dropped

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes