I'm running Rails 5.1.4 server (Puma v. 3.10.0 in single mode), but having an issue with a specific ActionJob that get's enqueued correctly but often never performed.
I have a handful of jobs. All but 1 specific job always gets performed asynchronously like expected shortly after enqueuing them.
First time after a server restart my specific job gets performed correctly after a new queueing. But after the first successful run, it will not get performed on following enqueuings.
I'm queueing all jobs generally with perform_later
.
I've tested queuing the specific job using rails console
as well. Whenever I queue it in the console, it gets performed instantly. Even in same session. Also tried with same arguments as used in the application when it's getting queued in the rails server
, but in server it only gets queued. Never performed.
I've checked the log files - there is nothing, no errors, no fatals, no warnings. It simply states [ActiveJob] Enqueued FooBaaJob
, but never performs the job.
If the job actually failed, it should at least still get to write out [ActiveJob] [FooBaaJob] [id] Performing FooBaaJob
in the log, but it doesn't.
And per https://github.com/rails/rails/blob/master/activejob/lib/active_job/logging.rb#L78 it should actually catch and log the exception if it was failing. Secondly it never fails to run in console, so that shouldn't be the case.
Any ideas about where to look?
async
(default - not set explicitly) and all jobs indefault
queue. Whenever I try to run the job queueinline
it always executes the job successfully. – Radiothoriumasync
will spawn a new Thread? – Kisnerrails server
command with no additional Puma config than default. However all my other jobs runs as expected, it's only this one specific job that fails. – Radiothorium