isinstance sent Celery down an infinite loop