-
Notifications
You must be signed in to change notification settings - Fork 100
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
Solid Queue is not retrying job #110
Comments
Hey @zainonrails, what's your workers and dispatchers configuration? How are you enqueuing the job? |
@rosa I am enqueuing the job simply by after adding database record in [SolidQueue] Enqueued job {:queue_name=>"development_default", :active_job_id=>"b720f935-3277-403f-85a3-782794d79937", :priority=>nil, :scheduled_at=>Tue, 02 Jan 2024 00:59:10.827070000 UTC +00:00, :class_name=>"SubmitTestimonialJob", :arguments=>{"job_class"=>"SubmitTestimonialJob", "job_id"=>"b720f935-3277-403f-85a3-782794d79937", "provider_job_id"=>nil, "queue_name"=>"development_default", "priority"=>nil, "arguments"=>[49], "executions"=>0, "exception_executions"=>{}, "locale"=>"en", "timezone"=>"UTC", "enqueued_at"=>"2024-01-02T00:59:10Z"}, :concurrency_key=>nil}
05:59:10 web.1 | [ActiveJob] Enqueued SubmitTestimonialJob (Job ID: b720f935-3277-403f-85a3-782794d79937) to SolidQueue(development_default) with arguments: 49 production:
dispatchers:
- polling_interval: 5
batch_size: 100
workers:
- queues: '*'
threads: 2
processes: 1
polling_interval: 5
development:
dispatchers:
- polling_interval: 1
batch_size: 10
workers:
- queues: "*"
threads: 3
processes: 1
polling_interval: 1 |
Cool, and when you say "it is not working consistently" and "The behaviour seems unpredictable", what do you mean? Could you be more specific? |
So, I am throwing exception in my job to see if it would pick up the retry settings or not. After the job throws error, I quickly update the job code to remove the exception part to see if it retries it but doesn't happen unfortunately. and upon restarting the server it picks up all the jobs. Maybe I am doing something wrong here to test this behaviour. Can you brief me on if the settings would be picked up if a worker receives an error in the job. Should I override |
Hmm... my guess is that the 3 retries happen before you get a chance to update the job:
This would be using the default wait time between retries, which is 3 seconds, so after roughly 9 seconds, the 3 attempts would have been done and your job would fail permanently. You should see it in the
|
I did try it with longer wait time like 5 and 10 seconds but let me go observe with longer wait times and confirm and report back. Thanks @rosa |
I too wanted to check if jobs were properly retried in my setup. Turns out the first retry occurences happen quite quickly as suggested by Rosa. You can also check the failed job job_id = YOUR_JOB_ID
@job = SolidQueue::Job.find(job_id)
@job.arguments["executions"] # This returns the number of times this job was executed
@job.arguments["exception_executions"] # This returns the breakdown of executions per exceptions Here's an example for one of my jobs:
|
I experimented it this timw without changing the code in between, with just 1 minute to wait for retry. The job was retried as expected and the number of executions were also updated. Just one question though, does What I observed is that it would run a total of that amount we set and not retry counts, that's why executions is |
Thanks @virolea, @zainonrails!
A total of 3 times according to Active Job's |
Thanks for the help everyone, closing this issue. |
I am trying to retry a failed job by using
retry_on
in the job class but it is not working consistently.I have also overridden
but nothing happens. I have tried with and without it. The behaviour seems unpredictable or it is just me.
Also throws this error sometimes,
How can I make sure the job is retried after any exception? any help would be appreciated.
Thanks
The text was updated successfully, but these errors were encountered: