RecurringJobs being enqueued from other queues

Hi all :smile:

I’m running Hangfire on a single database, with one primary asp.net server, but also multiple development asp.net servers.

Each server has hangfire configured to only look at its own queue:

app.UseHangfireServer(new BackgroundJobServerOptions() { Queues = new[] { machineName } });

I am adding a RecurringJob, with a unique ID for each server - recurring every minute:

RecurringJob.AddOrUpdate("ReceiptSend " + machineName, () => Background_ReceiptSend(), "* * * * *", null, machineName);

The primary server is permanently online, and the development servers are on and off.

My problem is that when a development server is offline, its Jobs are still being enqueued by the other servers that are online.

This seems like incorrect behaviour - I have only told each Hangfire instance to look at queues for that particular machineName. Why are they enqueuing jobs for other queues? This seems like a bug, as when I then start up a development server, it often has to run ~1000 jobs that have been queued up by OTHER servers (that should not have been even looking at that queue).

Thanks!

Strange behavior. I noticed about your post and started trying to hack Worker process but it always look to Queues property which comes from BackgroundJobServerOptions. Btw I’ll try to simulate your situation locally.