Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nicolás Cova 48 posts 120 karma points
    Sep 28, 2022 @ 21:15
    Nicolás Cova
    1

    Hangfire server running jobs from another Hangfire server

    Hi everyone,

    I'm having a particular issue with Hangfire (1.7.30) and Umbraco (7.15.6) and I'm wondering if anyone here has come across a similar situation. Here's what's happening:

    I have an Umbraco installation that creates a Hangfire server (let's call it Server-A) and a queue (let's call it Queue-A) to run its jobs. I have a copy of that same installation running (for load balancing issues) that reads the same SQL Server database, creates its own Hangfire server (let's call it Server-B) and its own queue (let's call it Queue-B). Server-A registers all of its jobs in Queue-A and Server-B registers its jobs to Queue-B.

    What happens is that when both installations start, Server-A runs the jobs that have been scheduled on both Queue-A and Queue-B and Server-B rarely runs any job at all. Somebody mentioned over at Hangfire's Github that the library has a run-at-least-once policy, but I find it kind of absurd that jobs that have been explicitly assigned to a specific queue are picked up by another queue. I also read that a possible fix is to create separate SQL tables for each server, but I can't do that because the second Umbraco installation is set to auto-scale.

    Has anybody else come across something like this with Hangfire and/or figured out a workaround?

Please Sign in or register to post replies

Write your reply to:

Draft