Server enqueueing incorrect jobs

I’m seeing an issue with the RecurringJob type when I have two processes, each with their own BackgroundJobServer instance running, queueing each others jobs. For example, server 1 handles jobs in a queue named “server1” and server 2 handles jobs in a queue named “server2” (same database). I set this up using the BackgroundJobServerOptions.Queues property. Each server processes it’s own queue jobs just fine. But, when I stop Server 2, and look at the dashboard. I notice that the Server 2 jobs are not being processed, which is correct, but they are still being created and put into an enqueued status. Why is server 1 adding jobs to the “server2” queue?? Shouldn’t server 1 only be concerned with the jobs in the “server1” queue?

If I don’t want this to happen I have to make sure the processes for each server does not reference the others code library, then it won’t queue up the other servers jobs…but, instead it throws a First-Chance exception, which doesn’t seem very correct…

Can someone tell me if this is expected behavior or if it’s a bug?

It’s a expected behavior.
You have 2 Hangfire servers (the part that executes the jobs) and 2 clients (the parts that en queue the jobs. Even being on the same application, they are “distinct”).

You can en queue jobs even if there currently are no server online that can execute jobs this queue.
Since one server that executes it became online, it will start to fetch and process the jobs in the queues it’s bound.

On the jobs, probably you’re using the [Queue("queuename")] attribute.
If you want server1 to just en queue jobs for himself, the jobs the jobs it en queues must be on the queues that his hangfire server process, and, not in the others servers.
Or, you could use other database for the other server.