From 0dfef2699f3c0e317c081e3a6c7d6d4e8b833ec4 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 6 Jun 2022 12:27:33 +0200 Subject: [PATCH] Silence ResponseError from redis (#2674) --- src/pretix/base/views/tasks.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pretix/base/views/tasks.py b/src/pretix/base/views/tasks.py index 03c8d8809e..bc3206c11c 100644 --- a/src/pretix/base/views/tasks.py +++ b/src/pretix/base/views/tasks.py @@ -36,6 +36,7 @@ from django.utils import timezone, translation from django.utils.timezone import get_current_timezone from django.utils.translation import get_language, gettext as _ from django.views.generic import FormView +from redis import ResponseError from pretix.base.models import User from pretix.base.services.tasks import ProfiledEventTask @@ -68,6 +69,11 @@ class AsyncMixin: res.get(timeout=timeout, propagate=False) except celery.exceptions.TimeoutError: pass + except ResponseError: + # There is a long-standing concurrency issue in either celery or redis-py that hasn't been fixed + # yet. Instead of crashing, we can ignore it and the client will retry their request and hopefully + # it is fixed next time. + logger.warning('Ignored ResponseError in AsyncResult.get()') except ConnectionError: # Redis probably just restarted, let's just report not ready and retry next time data = self._ajax_response_data()