Some of the servers don't have heartbeat reported within the last minute hangfire

recurring
Tags: #<Tag:0x00007f8b9fe1abb8>

#1

Server automatically stopping when job is running and job is being aborted. It is creating multiple servers.

if (_backgroundJobServer == null)
{
HostingEnvironment.RegisterObject(this);
_backgroundJobServer = new BackgroundJobServer();
}


#2

You might have to show more code than that. It does however sound more like your code is being run in parallel or restarted often.
So tell how you are even running this code. Since if you are using an IIS, it is very likely to be a configuration issue with that.

You can check these nicely confusing guides: https://docs.hangfire.io/en/latest/background-processing/index.html

Personally I would suggest just running Hangfire servers in a Windows Service, it is much easier to control and setup. I simply don’t trust the IIS to handle a task managing server. The IIS is designed to handle webpages and webservices.