-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
Unique constraint violation messages in postgres error logs #1536
Comments
Hi! This is expected. Here is a previous issue about this: #1230
Hope that makes sense. This is also briefly documented here: https://github.com/bensheldon/good_job?tab=readme-ov-file#cron-style-repeatingrecurring-jobs We can keep this issue open to better document this in the readme. |
Hi, I have the same issue even for one process. After deep diving I think I found the potential reason. Here https://github.com/bensheldon/good_job/blob/main/lib/good_job/cron_manager.rb#L88 the delay can return a too short time and so the task execution is just before the next_at and so the next delay calculation can return something close to 0.01s ? |
FYI with this simple test :
I reproduce on my fly.io server
delay is 0 Didn't reproduced it on my mac, in docker on my mac, in docker on aws ec2, so it's linked to the fly.io virtualisation I think. |
@ccouton oh! I think I know what's happening in your example 🤝 Concurrent Ruby has a magic number ( And also maybe there is a little bit of clock drift or something too. We should probably check that the time both actually Would you want to try a PR for that? Otherwise I can get to it. |
will do it today |
⬆️ is it something acceptable ? |
Hello and thanks for your great work!
We are using latest GJ (multiple workers) and Googles cloudSQL postgres with it, and we got steady stream of unique constraint violation errors:
log: cloudsql.googleapis.com/postgres.log
error: duplicate key value violates unique constraint "
index_good_jobs_on_cron_key_and_cron_at_cond
"We get around 15 of those every 10 minutes. Nothing seems out of order when looking at GJ logs.
Would like to confirm that this is by design and nothing to worry about.
Thank you!
The text was updated successfully, but these errors were encountered: