rq-scheduler icon indicating copy to clipboard operation
rq-scheduler copied to clipboard

Some periodic jobs with repeat counts never go away

Open dstromberg opened this issue 11 years ago • 3 comments

If I start a periodic job with a repetition count of 5, and from within each invocation of that job I submit a single non-periodic job to another worker, the parent job's repetition count never makes it all the way to zero - the repetition count is effectively ignored, making the job last forever. Printing the repeat count within enqueue_job, I can see that it decrements a few times, and then stops going down before reaching zero.

However, if I start a periodic job with a repetition count of 5, and I don't submit another job from within it, the repetition count of the periodic job decrements as one would expect, and the job's periodic evaluation is eventually finished.

I'm working on getting permission to share a test program that highlights the issue.

dstromberg avatar Jun 27 '14 16:06 dstromberg

Here's some test code that replicates the problem:

http://stromberg.dnsalias.org/~strombrg/rq-scheduler/

HTH

dstromberg avatar Jun 27 '14 18:06 dstromberg

I'm afraid I couldn't reproduce the issue. The example you gave is kind of complex so I created my own tests using the bare minimum. In this gist you'll see that the job gets enqueued exactly three times.

https://gist.github.com/selwin/515049017c1e87112959

selwin avatar Jun 28 '14 12:06 selwin

Please check out my gist, is there anything I missed?

selwin avatar Jun 28 '14 12:06 selwin