kombu icon indicating copy to clipboard operation
kombu copied to clipboard

autoretry fails to honor max_retries if connection cannot be established

Open kgiusti opened this issue 7 years ago • 1 comments

If max_retries is passed to connection.autoretry() and the connection is not available then autoretry blocks until a connection is made regardless of the max_retries value.

See attached. If you set a bogus url (results in connection refused) you will see that the revive of the default channel is never passed the original value of max_retries.

$ python ./test.py /home/kgiusti/work/kombu/kombu/connection.py(487)_ensured() -> got_connection = 0 (Pdb) bt /home/kgiusti/work/kombu/test.py(42)() -> ret, channel = arm() /home/kgiusti/work/kombu/kombu/connection.py(487)_ensured() -> got_connection = 0 (Pdb) p max_retries 5 (Pdb) cont /home/kgiusti/work/kombu/kombu/utils/functional.py(330)retry_over_time() -> interval_range = fxrange(interval_start, (Pdb) bt /home/kgiusti/work/kombu/test.py(42)() -> ret, channel = arm() /home/kgiusti/work/kombu/kombu/connection.py(487)_ensured() -> got_connection = 0 /home/kgiusti/work/kombu/kombu/connection.py(571)call() -> self.revive(self.connection.default_channel) /home/kgiusti/work/kombu/kombu/connection.py(833)default_channel() -> self.ensure_connection(**conn_opts) /home/kgiusti/work/kombu/kombu/connection.py(406)ensure_connection() -> callback) /home/kgiusti/work/kombu/kombu/utils/functional.py(330)retry_over_time() -> interval_range = fxrange(interval_start, (Pdb) p max_retries None (Pdb) test.py.gz

kgiusti avatar Jan 30 '18 18:01 kgiusti

hope this is fixed by 4.6.x? if not please ping here. sorry for not able to reply earlier.

auvipy avatar Aug 24 '19 08:08 auvipy