Skip to content

Commit

Permalink
Fix for celery#1063. InconsistencyError is not raised here. Instead O…
Browse files Browse the repository at this point in the history
…perationalError is. We inspect ignore it if its the NO_ROUTE_ERROR, otherwise let it pass.
  • Loading branch information
hsophie-sf committed Oct 9, 2020
1 parent 92b8c32 commit 57e8ceb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion kombu/pidbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
from threading import local
from time import time

from kombu.transport import redis
from . import Exchange, Queue, Consumer, Producer
from .clocks import LamportClock
from .common import maybe_declare, oid_from
from .exceptions import InconsistencyError
from .exceptions import InconsistencyError, OperationalError
from .five import range, string_t
from .log import get_logger
from .utils.functional import maybe_evaluate, reprcall
Expand Down Expand Up @@ -284,6 +285,12 @@ def _publish_reply(self, reply, exchange, routing_key, ticket,
}, retry=True,
**opts
)
except OperationalError as exc:
# Fixes https://github.com/celery/kombu/issues/1063
if exc.args and exc.args[0] == redis.NO_ROUTE_ERROR.format(exchange, routing_key):
pass
else:
raise
except InconsistencyError:
# queue probably deleted and no one is expecting a reply.
pass
Expand Down

2 comments on commit 57e8ceb

@cdknorow
Copy link

Choose a reason for hiding this comment

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

This looks like the same problem I'm running into. WIll test the patch.

@hsophie-sf
Copy link
Owner Author

Choose a reason for hiding this comment

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

This looks like the same problem I'm running into. WIll test the patch.

You may want to use this instead since it captures the error properly: lambacck@7a4f97d

Please sign in to comment.