Excepton thrown when stopping background server?


#1

Hi,

Whenever I deploy HF to a cluster and run integration tests it seems there is an issue with stopping the background procressing server, this is the exception being thrown:

2019-09-09T15:10:37.2280418Z e[41me[1me[37mcrite[39me[22me[49m: Microsoft.AspNetCore.Hosting.Internal.HostedServiceExecutor[10]
2019-09-09T15:10:37.2280848Z An error occurred stopping the application
2019-09-09T15:10:37.2280958Z System.AggregateException: One or more errors occurred. (Cannot access a disposed object.
2019-09-09T15:10:37.2281459Z Object name: ‘Hangfire.Server.BackgroundProcessingServer’.) —> System.ObjectDisposedException: Cannot access a disposed object.
2019-09-09T15:10:37.2281797Z Object name: ‘Hangfire.Server.BackgroundProcessingServer’.
2019-09-09T15:10:37.2281930Z at Hangfire.Server.BackgroundProcessingServer.ThrowIfDisposed()
2019-09-09T15:10:37.2282022Z at Hangfire.Server.BackgroundProcessingServer.SendStop()
2019-09-09T15:10:37.2282093Z at Hangfire.BackgroundJobServerHostedService.StopAsync(CancellationToken cancellationToken)
2019-09-09T15:10:37.2282204Z at Microsoft.AspNetCore.Hosting.Internal.HostedServiceExecutor.<>c__DisplayClass4_0.b__0(IHostedService service)
2019-09-09T15:10:37.2282361Z at Microsoft.AspNetCore.Hosting.Internal.HostedServiceExecutor.ExecuteAsync(Func2 callback) 2019-09-09T15:10:37.2282697Z --- End of inner exception stack trace --- 2019-09-09T15:10:37.2282802Z at Microsoft.AspNetCore.Hosting.Internal.HostedServiceExecutor.ExecuteAsync(Func2 callback)
2019-09-09T15:10:37.2282927Z at Microsoft.AspNetCore.Hosting.Internal.HostedServiceExecutor.StopAsync(CancellationToken token)
2019-09-09T15:10:37.2283665Z —> (Inner Exception #0) System.ObjectDisposedException: Cannot access a disposed object.
2019-09-09T15:10:37.2283977Z Object name: ‘Hangfire.Server.BackgroundProcessingServer’.
2019-09-09T15:10:37.2284054Z at Hangfire.Server.BackgroundProcessingServer.ThrowIfDisposed()
2019-09-09T15:10:37.2284159Z at Hangfire.Server.BackgroundProcessingServer.SendStop()
2019-09-09T15:10:37.2284227Z at Hangfire.BackgroundJobServerHostedService.StopAsync(CancellationToken cancellationToken)
2019-09-09T15:10:37.2284456Z at Microsoft.AspNetCore.Hosting.Internal.HostedServiceExecutor.<>c__DisplayClass4_0.b__0(IHostedService service)
2019-09-09T15:10:37.2284788Z at Microsoft.AspNetCore.Hosting.Internal.HostedServiceExecutor.ExecuteAsync(Func`2 callback)<—

This doesnt seem to cause deployment to stop (all integration tests pass & they’re also in memory).

Any idea what could be causing this issue?