-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a job with a previously used id will silently drop the job #1828
Comments
This is actually not a bug but works as design. This behaviour is necessary in order to implement idempotent jobs: |
I get it but it means that all these jobs are stored in Redis? What if we add 500k per week? In a few months millions of jobs will end up in Redis. Is there an expiry setting for this? |
also, is there any way to manually clear this without dropping the whole redis database? |
You normally configure the queue to just keep a safe number of completed or failed jobs: |
Sorry, but I am still a bit confused, I have set removeOnComplete to true as you saw, but still the jobs were not fully removed and the job id was considered duplicate. Does this mean that in order to get them fully removed, I should set a number instead of true?i? |
with that setting they should be deleted when the job completes, can you provide a test example where this does not hold true? |
That was the original issue. The test case is exactly the code that I have in the main issue message. As I said, they appear to be deleted (in bull-board I see zero jobs) but when I tried adding them back (more than 6 times), it did not work until I did FLUSHALL in Redis. |
yes but we have code in the tests that demonstrates that the issue does not exist, so you need to provide me one test case that reproduces what you claim. |
to be clear, a piece of code that I can run directly. |
We ran into the same issue, adding job with the same |
@coder-pm |
@manast, sorry for the delay in responding. We have been quite busy lately. I can confirm that the issue I mentioned exists in |
Is this issue resolved? |
Hello, i have faced some issue, as mentioned above. When try to create jobs with same jobId, in most cases are working fine, but sometimes i do see in redis a bull job eg with name |
Description
We use the database primary key as job_id, after a successful run of the queue, when we want to run it again for the next update, queue.add works but the jobs are not added back. It fails silently! Clearing redis with FLUSHALL will solve the problem.
Minimal, Working Test code to reproduce the issue.
Let it complete
Repeat stage 2. This time 98% of the jobs are not added in the waiting list.
Go to redis-cli and run FLUSHALL
It works
Bull version
3.18.0
Additional information
The text was updated successfully, but these errors were encountered: