arq icon indicating copy to clipboard operation
arq copied to clipboard

Fix recursion while waiting for redis connection

Open nierob opened this issue 3 years ago • 4 comments

Arq has ability to retry connections to redis in case of problems. That is a nice feature, but it crashes after hundreds of attempts reaching maximal recursion depth. This change modifies re-try algorithm from recursion to iteration avoiding the limit.

In practice it would be nice to have ability to wait forever as issue with redis instance should not kill worker process, but that is a separate change that can be built on top.

Fixes exception when retrying redis connection many times: RecursionError: maximum recursion depth exceeded while getting the str of an object

nierob avatar May 19 '22 13:05 nierob

Codecov Report

Merging #311 (3ff25ad) into main (b4b40ad) will increase coverage by 0.10%. The diff coverage is 100.00%.

:exclamation: Current head 3ff25ad differs from pull request most recent head 2eab750. Consider uploading reports for the commit 2eab750 to get more accurate results

@@            Coverage Diff             @@
##             main     #311      +/-   ##
==========================================
+ Coverage   98.77%   98.87%   +0.10%     
==========================================
  Files          11       11              
  Lines         980      981       +1     
  Branches      183      183              
==========================================
+ Hits          968      970       +2     
  Misses          6        6              
+ Partials        6        5       -1     
Impacted Files Coverage Δ
arq/connections.py 95.55% <100.00%> (+0.03%) :arrow_up:
arq/worker.py 99.55% <0.00%> (+0.22%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b4b40ad...2eab750. Read the comment docs.

codecov[bot] avatar May 19 '22 13:05 codecov[bot]

Hi, all the failures in CI feels unrelated, should I do something more to get this PR merged?

nierob avatar Jun 01 '22 06:06 nierob

3.9 failure looks intermittent, might be worth rerunning.

If you can fix the problem with click that would be great, otherwise I will.

samuelcolvin avatar Jun 01 '22 08:06 samuelcolvin

3.9 failure looks intermittent, might be worth rerunning.

I have no means of re-running other then changing something and re-pushing. I guess it is related to some permissions.

If you can fix the problem with click that would be great, otherwise I will.

https://github.com/samuelcolvin/arq/pull/312

nierob avatar Jun 01 '22 13:06 nierob

Thanks so much.

By the way, you can always re-run CI using git commit -m bump --allow-empty.

samuelcolvin avatar Aug 23 '22 16:08 samuelcolvin