One of my jobs is showing odd behaviour, the job beings processing properly on a worker, then 30 min later another worker picks up the job, this keeps happening every 30 min until all my workers are processing the same job. I have many different types of jobs, some of which run for longer than 30 min without any problems. I am at a loss as to why this is happening, has anyone encountered anything similar?
I guess you are hitting the default timeout for SQL Server stored jobs. See: http://docs.hangfire.io/en/latest/configuration/using-sql-server-with-msmq.html.
Thanks for pointing me in the correct direction, this page seems to describe my scenario exactly, http://docs.hangfire.io/en/latest/configuration/using-sql-server.html#invisibility-timeout.
1.5 has removed the restriction of invisibility time out., see if you could upgrade your project.
excellent, I will be updating as soon as it is out of beta
@dmehta: do you know if the new 1.5 “instant re-queue” feature also makes the start of a job instant (previously there was a delay of a second or more without MSMQ)?
When using SQL server without MSMQ, the queue polling interval (QueuePollInterval) determines when the job will be processed. I think the default is 15 seconds, so the job may need to wait a max of 15 seconds before it will be picked up for processing.
With MSMQ, there is no polling so jobs will be picked up instantly.
Ok so I updated to 1.5, instead of hitting a 30 min invisibility timeout, the same jobs are now exhibiting the same behaviour after 1-3 minutes. This is a much bigger problem, most of my jobs run in under 30 minutes so was only seeing the first behaviour occasionally, now almost all my jobs take close to 5 minutes to run so having them switch workers after 1 minute means they are never completing and eating up all the workers so nothing else completes.
Anyone know what the hell is going on?
Turning off MSMQ appears to have resolved this for now.
I am having a issue. where hangfire run muliple process for one server.