Hello,
I have two services that use Hangfire on the same SqlServer database. Each one uses its own queue name, so that calls performed by service A will always be processed by server A.
The problem is that it seems that only one service at a time is processing the queues, while the other stops. I couldn’'t find a pattern in this behaviour as sometimes happens that both work fine, or that server A works while server B stops and viceversa.
The services are deployed on the same machine but each one uses its own application pool.
Here’s log from the server that doesn’t work fine after an IIS restart and a call to a method that performs a Hangfire call:
2015-09-17 11:33:41|Info|Hangfire.SqlServer.SqlServerStorage|Hangfire.Logging.LogProviders.NLogLogProvider+NLogLogger.Log|Hangfire SQL objects installed.
2015-09-17 11:33:41|Trace|Hangfire.Server.AutomaticRetryServerComponentWrapper|System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2|Starting a new thread for server component ‘Server Bootstrapper’…
2015-09-17 11:33:41|Info|Hangfire.BackgroundJobServer|Hangfire.Logging.LogProviders.NLogLogProvider+NLogLogger.Log|Starting Hangfire Server
2015-09-17 11:33:41|Info|Hangfire.BackgroundJobServer|Hangfire.Logging.LogProviders.NLogLogProvider+NLogLogger.Log|Using job storage: ‘SQL Server: [XXXXXXXXXXX]@[XXXXXXX]_HangFire’.
2015-09-17 11:33:41|Info|Hangfire.BackgroundJobServer|Hangfire.Logging.LogProviders.NLogLogProvider+NLogLogger.Log|Using the following options for SQL Server job storage:
2015-09-17 11:33:41|Info|Hangfire.BackgroundJobServer|Hangfire.Logging.LogProviders.NLogLogProvider+NLogLogger.Log| Queue poll interval: 00:00:15.
2015-09-17 11:33:41|Info|Hangfire.BackgroundJobServer|Hangfire.Logging.LogProviders.NLogLogProvider+NLogLogger.Log| Invisibility timeout: 00:30:00.
2015-09-17 11:33:41|Info|Hangfire.BackgroundJobServer|Hangfire.Logging.LogProviders.NLogLogProvider+NLogLogger.Log|Using the following options for Hangfire Server:
2015-09-17 11:33:41|Info|Hangfire.BackgroundJobServer|Hangfire.Logging.LogProviders.NLogLogProvider+NLogLogger.Log| Worker count: 20.
2015-09-17 11:33:41|Info|Hangfire.BackgroundJobServer|Hangfire.Logging.LogProviders.NLogLogProvider+NLogLogger.Log| Listening queues: ‘supportservice’.
2015-09-17 11:33:41|Info|Hangfire.BackgroundJobServer|Hangfire.Logging.LogProviders.NLogLogProvider+NLogLogger.Log| Shutdown timeout: 00:00:15.
2015-09-17 11:33:41|Info|Hangfire.BackgroundJobServer|Hangfire.Logging.LogProviders.NLogLogProvider+NLogLogger.Log| Schedule polling interval: 00:00:15.
2015-09-17 11:33:41|Trace|Hangfire.Server.AutomaticRetryServerComponentWrapper|Hangfire.Logging.LogProviders.NLogLogProvider+NLogLogger.Log|Sending start request for server component ‘Server Bootstrapper’…
2015-09-17 11:33:41|Debug|Hangfire.Server.AutomaticRetryServerComponentWrapper|System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2|Starting server component ‘Server Bootstrapper’…
2015-09-17 11:33:41|Debug|Hangfire.Server.AutomaticRetryServerComponentWrapper|Hangfire.Logging.LogProviders.NLogLogProvider+NLogLogger.Log|Server component ‘Server Bootstrapper’ started.
The log from the working services show a lot of lines like
2015-09-17 11:45:54|Debug|Hangfire.SqlServer.CountersAggregator|Hangfire.Logging.LogProviders.NLogLogProvider+NLogLogger.Log|Aggregating records in ‘Counter’ table…
Any idea?
Спасибо вам большое
Paolo