Skip to content

Commit

Permalink
Merge pull request #126 from cloudblue/bugfix/LITE-27014
Browse files Browse the repository at this point in the history
LITE-27014 Correct handling of AssertionError on `produce` in RabbitMQ
  • Loading branch information
maxipavlovic committed Apr 4, 2023
2 parents 3ff5271 + e5b6342 commit a054973
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions dj_cqrs/transport/rabbit_mq.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def _produce_with_retries(cls, payload, retries):
exceptions.ChannelError,
exceptions.ReentrancyError,
AMQPConnectorException,
AssertionError,
) as e:
# in case of any error - close connection and try to reconnect
cls.clean_connection()
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/rdbms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ services:
bash -c '
dockerize -wait tcp://postgres:5432 -timeout 50s &&
dockerize -wait tcp://mysql:3306 -timeout 50s &&
pytest
pytest -v
'
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Django>=3.2
Django>=3.2,<4.2
pika>=1.0.0
kombu>=4.6
ujson>=5.4.0
Expand Down
2 changes: 1 addition & 1 deletion tests/test_transport/test_rabbit_mq.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def rabbit_transport(settings):


@pytest.mark.parametrize(
'exception', (AMQPError, ChannelError, ReentrancyError, AMQPConnectorException),
'exception', (AMQPError, ChannelError, ReentrancyError, AMQPConnectorException, AssertionError),
)
def test_produce_connection_error(exception, rabbit_transport, mocker, caplog):
mocker.patch.object(RabbitMQTransport, '_get_producer_rmq_objects', side_effect=exception)
Expand Down

0 comments on commit a054973

Please sign in to comment.